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

Tests

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.