Issues

ZF-10548: Zend_Tool_Project_Context_Zf_BootstrapFile::getApplicationInstance() does not allow for config[]=... in application.ini

Issue Type: Improvement Created: 2010-10-11T08:55:10.000+0000 Last Updated: 2012-05-18T12:05:39.000+0000 Status: Reopened Fix version(s): Reporter: Bas K (bas) Assignee: Ralph Schindler (ralph) Tags: - Zend_Tool

Related issues: - ZF-10945

Attachments:

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

<pre class="highlight">
    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

<pre class="highlight">
    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.

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts