ZF-6345: Ability to get at Zend_Config object?
Description
It would be nice if you could get at the Zend_Config object that Zend_Application loads from within the bootstrap object. Seems a shame to have to load it twice.
It would be nice if you could get at the Zend_Config object that Zend_Application loads from within the bootstrap object. Seems a shame to have to load it twice.
Comments
Posted by -.- (campasau) on 2009-05-11T06:06:37.000+0000
You don't have to load it twice. Just do this:
\
Posted by Ingo Theiss (itheiss) on 2009-06-26T04:18:47.000+0000
You can“t blindly use $application->getOptions(), because the Zend_Config object is convertet to an array and than gets passed to $application->setOptions(array $options). ALL array keys are converted to lowercase!
If you are using camelcase in you config you are lost....
Posted by Rob Allen (rob) on 2009-07-05T03:16:34.000+0000
This has just bitten me and is a right pain.
It only affects the toplevel keys though, so one workaround is to put all the rest of your configuration within a top level key such as "app".
Posted by Rafael Machado Dohms (rdohms) on 2009-07-24T04:56:51.000+0000
This same issue is beign discussed here and a patch is beign analysed to see if its worth implementing, performance-wise.
Posted by Rafael Machado Dohms (rdohms) on 2009-09-18T19:18:44.000+0000
After r17801 options are no longer stored with flattened keys, thus creating a Config File with the suggestion mentioned in the first comment is now a viable solution to the problem.