ZF-6017: Zend_Loader_PluginLoader ignores LIFO order
Description
Zend_Loader_PluginLoader ignores LIFO order while trying to overwrite classes from other namespaces with an already registered prefix.
Assuming the following structure
application/
modules/
foo/
views/
helpers/
MyHelper.php
library/
Zend/
View/
Helper/
My/
View/
Helper/
MyHelper.php
Creating the plugin loader
$loader = new Zend_Loader_PluginLoader();
$loader->addPrefixPath('Zend_View_Helper', 'Zend/View/Helper/')
->addPrefixPath('My_View_Helper', 'My/View/Helper')
->addPrefixPath('Zend_View_Helper', 'application/modules/foo/views/helpers');
The following
$myHelperClass = $loader->load('MyHelper');
now loads the class from My/View/Helper instead of application/modules/foo/views/helpers which i would expect.
Comments
Posted by Jan Sorgalla (jsorgalla) on 2009-03-13T03:03:22.000+0000
Tests
Posted by Rob Allen (rob) on 2012-11-20T20:53:25.000+0000
Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".
Feel free to re-open and provide a patch if you want to fix this issue.