ZF-7419: Allow Bootstrap::getOption to return Zend_Config Object

Issue Type: Improvement Created: 2009-07-30T03:00:21.000+0000 Last Updated: 2012-11-20T21:38:15.000+0000 Status: Open Fix version(s): Reporter: Fergus Hadley (voidstate) Assignee: None Tags: - Zend_Application

  • Zend_Config

Related issues: Attachments:


Currently, almost every time I use the getOption() method in a Zend Application bootrap class, I have to wrap it in "new Zend_config()".

For example:

$Front->getRouter()->addConfig( new Zend_Config( $this->getOption( 'routes' ) ) );

It would be good to have the option to have the array automatically converted to a Zend_config object.

Change would need to be made to Zend_Application_Bootstrap_BootstrapAbstract::getOption()


Posted by Ben Scholzen (dasprid) on 2009-07-30T03:08:19.000+0000

The router is the only component where a Zend_Config object is required, which will be fixed with ZF 2.0.

Posted by julien PAULI (doctorrock83) on 2009-09-29T11:48:53.000+0000

Yes, any Zend component except router has a method such as setOptions($array) in addition to setConfig(Zend_Config).

Posted by Jonathan Reid Kushner (jkushner1019) on 2010-12-10T07:22:26.000+0000

This is because the bootstrap receives the options array from the application class on instantiation, and when you request options from the bootstrap class, you are receiving a merged version of options in an array format. i think its the standard to have the options in the array format for the application component.

Have you found an issue?

See the Overview section for more details.


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

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