Issues

ZF-8159: Zend_Config_Ini doesn't load multiple sections correctly

Description

If you pass an array of sections to Zend_Config_Ini the sections are merged using array_merge(). This is a problem when you are using the config to create a Zend_Form, as all the elements are under the "elements" key, so when they are merged you end up with only the elements from one of the sections.

Example: test.ini file

[first]
user.login.elements.username.type = "text"
[second]
user.login.elements.password.type = "password"

load array of sections

$sections = array('first', 'second');
$config = new Zend_Config_Ini(CONFIG . 'test.ini', $sections);
$this->view->form = new Zend_Form($config->user->login);

Behaviour: only one form element displayed.

Changing line 152 of Zend/Config/Ini.php to use array_merge_recursive() fixes this for me.

Comments

affects 1.9.5 too

Fixed in r19056.

Please use r19059 instead of r19059 because it contains a possible error in merging config data.

...r19059 instead of r19056...