ZF-9435: Zend_Application_Bootstrap_Boostrap::getResourceLoader() calculates extra, invalid paths for Autoloader

Issue Type: Performance Improvement Created: 2010-03-16T10:22:08.000+0000 Last Updated: 2013-03-13T08:01:31.000+0000 Status: Reopened Fix version(s): - 1.12.1 (18/Dec/12)

Reporter: Ken Stanley (dohpaz) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Application

  • FixForZF1.12
  • zf-caretaker-adamlundrigan

Related issues: Attachments: - ZF-9435.patch


If an application is using an empty appnamespace, the Zend_Application_Bootstrap_Boostrap::getResourceLoader() incorrectly adds the path to Zend/Application/Bootstrap to the autoloader, causing the application to have to scan extra directories when looking to map plugins, models, etc. Attached is a patch that changes the identical comparison to an equality comparison when testing the appnamespace to avoid the extra erroneous paths.


Posted by Adam Lundrigan (adamlundrigan) on 2012-05-18T12:01:59.000+0000

Downgrading to minor performance improvement

Posted by Rob Allen (rob) on 2012-11-06T19:32:11.000+0000

Fixed in trunk(25072) and release-1.2(25073)

Posted by Jacek Kobus ( on 2013-01-15T21:45:51.000+0000

So now if I have application/plugins Plugin_Example the autoloader will not find it, unless I'll add a resource loader to the loader's stack ? All my applications stopped working after this path.

Posted by Frank Br├╝ckner (frosch) on 2013-01-16T07:05:46.000+0000

@Jacek Register your plugin. Look at the docs. (Example #5)

Posted by Jacek Kobus ( on 2013-01-16T11:27:33.000+0000

Hello Frank, thanks for your response. That's not a problem with plugin registration as it is already registered. It just doesnt know that Plugin_ resides in /plugins.

I'm using default directory structure and all resources fail to load as Zend_Application_Module_Autoloader pointing to my APPLICATION_PATH is not initialized anymore. application/services Service_ application/models Model_ application/plugins Plugin_ application/forms Form_

Those are "application-wide" resources used in all modules. My default module resides in /modules/default and that is probably the problem here.

So if anyone out there is using such structure, and APPLICATION_PATH/{model|form|etc...} to store their base classes or reusable components for other modules, after update to 1.12.1 it will stop working.


<pre class="highlight">
public function _initResourceLoader()
        if($this->getResourceLoader() === null){
            $this->setResourceLoader(new Zend_Application_Module_Autoloader(array(
                'namespace' => $this->getAppNamespace(),
                'basePath'  => dirname(__FILE__),

Posted by Christoph Roensch (croensch) on 2013-03-12T14:22:19.000+0000

I use this too, simply to load "Form_Foo" from "/application/forms/Foo.php". Now it breaks :(

<pre class="highlight">
<a href="">production]
appNamespace = ;Zend_Application_Module_Autoloader

If i delete that entry, everything works as intended, no resource loader is built. Haven't tested for modules tough.

I suspect the source code change was not need, maybe it's possible to reach the desired performance improvement with a more precise/explicit configuration and still have the [#AbuseCase to work with.

Posted by Christoph Roensch (croensch) on 2013-03-13T08:01:31.000+0000

I like to reopen and revert this. To my understanding the feature worked as intended.

Have you found an issue?

See the Overview section for more details.


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

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