ZF-10548: Zend_Tool_Project_Context_Zf_BootstrapFile::getApplicationInstance() does not allow for config[]=... in application.ini
Description
Zend_Application will read and merge multiple configuration files when in a .ini file you specify an attribute like so;
config[] = path/to/other.ini
Zend_Tool currently doesn't honor this method, because it utilizes the config attribute itself. This forces a developer to not use the configs directories if he also uses Zend_Tool.
Simple enough to fix in Zend_Tool_Project_Context_Zf_BootstrapFile::getApplicationInstance
public function getApplicationInstance()
{
if ($this->_applicationInstance == null) {
if ($this->_applicationConfigFile->getContext()->exists()) {
define('APPLICATION_PATH', $this->_applicationDirectory->getPath());
$applicationOptions = array();
$applicationOptions['config'] = $this->_applicationConfigFile->getPath();
$this->_applicationInstance = new Zend_Application(
'development',
$applicationOptions
);
}
}
}
To
public function getApplicationInstance()
{
if ($this->_applicationInstance == null) {
if ($this->_applicationConfigFile->getContext()->exists()) {
define('APPLICATION_PATH', $this->_applicationDirectory->getPath());
$this->_applicationInstance = new Zend_Application(
'development',
$this->_applicationConfigFile->getPath()
);
}
}
return $this->_applicationInstance;
}
Comments
Posted by Bas K (bas) on 2011-01-13T11:40:12.000+0000
please see http://framework.zend.com/issues/browse/ZF-10945 as this turned out to be an issue with Zend_Application
Posted by Bas K (bas) on 2011-05-10T17:53:40.000+0000
The behavior seen is actually not a issue with Zend_Tool but with the way Zend_Application handles its invocation (see issue 10945).
The simplest solution would be to change the (mentioned in this post) code so it works around the issue.