ZF-9435: Zend_Application_Bootstrap_Boostrap::getResourceLoader() calculates extra, invalid paths for Autoloader
Description
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.
Comments
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 (jacekkobus.com) 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 (jacekkobus.com) 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.
{
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 :(
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.