ZF-6289: Zend_Config_Writer_Ini jumbling sections


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.


Fixed in r21983.


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?

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.

Applied to branch release-1.10 in r22869.