Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Blocker
-
Resolution: Unresolved
-
Affects Version/s: 1.10.0, 1.10.1, 1.10.2
-
Fix Version/s: None
-
Component/s: Zend_Application
-
Labels:
Description
There is currently support for 'config' option that may be either an array or a file path string. It is used to override current options. It may be very useful to use some local configurations, like having configs/application.local.ini for some specific machine related options.
If it is an array it works good but if it is a file it does not because it merges first, original options to the second (so the origin options override the local ones).
Please, somebody change
$options = $this->mergeOptions($this->_loadConfig($options['config']), $options);
to
$options = $this->mergeOptions($options, $this->_loadConfig($options['config']));
in /Zend/Application.php line 134 (1.10.2 release)
I see some refactoring being done there, so it's probably a new issue. Probably since 1.10
Issue Links
| This issue is related to: | ||||
| ZF-10945 | new Zend_Application('ENV', array('config' => 'path/to/conf')) does not load externally references configuration files |
|
|
|
Since there is no any response here for about a month (though new 10.3 just came out recently) I've decided to prepare patch/test for this issue to have it fixed faster, probably. And I found out why this was changed: http://framework.zend.com/issues/browse/ZF-6811
I.e. there is a BC break since 1.10 to be able to "overwrite ini data via the constructor call " like:
$app = new Zend_Application( APPLICATION_ENV, array( 'bootstrap' => array( 'class' => 'XmlRpc_Bootstrap', 'path' => 'path/to/Bootstrap.php', ), 'config' => APPLICATION_PATH . '/configs/application.ini', ), );this way 'config' option becomes the real config path, not the additional one. Probably in some cases it is comfortable to do this thing via constructor call but it's not just logical imho so I would vote it to be changed back . Currently an option of the config becomes the config itself - it isn't that obvious is it?
If it's a really common use case with that constructor thing I would suggest to add another parameter to the Zend_Application constructor which would contain options to overwrite the main config.
I'll change it to an improvement issue though.
Another little thing if somebody cares in the documentation here http://framework.zend.com/manual/en/zend.application.core-functionality.html it's said:
'configs' is wrong and causes an error. Should be just 'config'.
$app = new Zend_Application( APPLICATION_ENV, array( 'bootstrap' => array( 'class' => 'XmlRpc_Bootstrap', 'path' => 'path/to/Bootstrap.php', ), 'config' => APPLICATION_PATH . '/configs/application.ini', ), );