ZF-5630: Zend_Config_Ini examples are wrong


In several places you see this example:

$options['nestSeparator'] = ':'; $config = new Zend_Config_Ini('/path/to/config.ini', 'staging', $options);

Followed by this example ini code:

; Production site configuration data [production] webhost = database.adapter = pdo_mysql = database.params.username = dbuser database.params.password = secret database.params.dbname = dbname

However, when the user follows this example literally, the resulting $config object is not correctly populated. For instance:

echo $config->database->params->host

Results in Notice: Trying to get property of non-object in

Changing the nestSeparator character to a dot (which is the character used in the ini sample above, results in a correctly populated config object.

This is prevelant in these pages:…

For new users this could be very frustrating and lead them to believe it's a bug in Zend code.


I can see why the documentation can be confusing, but I actually don't think it's wrong.

The first 3 lines of code you write is just an example of how you can change the "nestSeparator"-option, while the sample ini code is an example in general. The "nestSeparator" defaults to a dot "." and that should work correctly with the sample ini code.

At least that's how I read it, but I agree that it could be written (and visualised) better :).

Not an issue, as the example on… has the code under the INI file that correctly uses the dot separator.

It would be nice if a "note" in the docs was visually separated with a border though.