2010年1月11日星期一

Re: [fw-mvc] Manage multiple config file paths with Zend_Application

I believe there is a 4th solution of some sorts - have a look at

[x] Zend_Application::setOptions()

and there, you'll see the following code

if (!empty($options['config'])) {
$options = $this->mergeOptions($options,
$this->_loadConfig($options['config']));
}

- so, you can specifiy another configuration file there which will
automatically be merged with the options specified in the configuration
file, array or Zend_Config passed to the constructor of Zend_Application.

Still, this allows only for loading one configuration file in addition,
as Zend_Application::_loadConfig() will only nip on a single file.

So, subclassing Zend_Application might be an option, if it's feasable.


Best regards,

Andreas

没有评论: