ZF-5630: Zend_Config_Ini examples are wrong

Issue Type: Docs: Problem Created: 2009-01-25T09:00:45.000+0000 Last Updated: 2009-03-21T13:12:08.000+0000 Status: Resolved Fix version(s): Reporter: Mark Williamson (thetazzbot) Assignee: Rob Allen (rob) Tags: - Zend_Config

Related issues: Attachments:


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.


Posted by Jan Olsen (janpolsen) on 2009-02-11T11:05:48.000+0000

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 :).

Posted by Rob Allen (rob) on 2009-03-21T13:12:08.000+0000

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.

Have you found an issue?

See the Overview section for more details.


© 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.