Issues

ZF-6289: Zend_Config_Writer_Ini jumbling sections

Issue Type: Bug Created: 2009-04-13T15:19:47.000+0000 Last Updated: 2010-08-21T07:00:20.000+0000 Status: Resolved Fix version(s): - 1.10.8 (25/Aug/10)

Reporter: Karl Pierce (fish3046) Assignee: Jan Pieper (jpieper) Tags: - Zend_Config_Writer

Related issues: - ZF-10095

Attachments:

Description

The issue is with Zend_Config_Writer_Ini. When you build a Zend_Config object and add data elements to it, the writer writes them out to the file in the order they were added. This creates problems when you add sections, then add more root level data to the config afterwards. For example, creating an object like this: $schema = new Zend_Config(array( 'menuName' => $this->menuName, 'tableName' => $this->tableName, 'fields' => array(), 'type' => $this->type, 'order' => $this->order ), true); The fields section is build later (i have the code available but i don't think it matters) but the basic idea is to have a [fields] section with various elements beneath it. When Zend_Config_Writer_Ini writes this out to the file, it will print out like this:

menuName = "Multi Record" tableName = "multi_record" [fields] data = "data"

type = "multi" order = 1

This puts type and order under the [fields] section, when it should be up next to tableName and menuName, which is under the root section. I feel the solution would be to process seperate sections last, so all root keys are not written at the bottom like this changing their context.

Comments

Posted by Jan Pieper (jpieper) on 2010-04-25T01:09:34.000+0000

Fixed in r21983.

Posted by Rob Allen (rob) on 2010-06-02T11:42:57.000+0000

Jan,

You've marked this as fixed in 1.10.4, but it doesn't seem to have been merged from trunk to the branch?

Is there a reason it wasn't merged?

Posted by Jan Pieper (jpieper) on 2010-06-02T23:43:55.000+0000

I only commited my changes to trunk but there shouldn't be any problems to not merge them to the mentioned branch or a newer one.

Posted by Ramon Henrique Ornelas (ramon) on 2010-08-21T07:00:20.000+0000

Applied to branch release-1.10 in r22869.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts