Zend Framework

Zend_Loader_PluginLoader ignores LIFO order

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Zend_Loader
  • Labels:
    None

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.

Activity

Hide
Jan Sorgalla added a comment -

Tests

Show
Jan Sorgalla added a comment - Tests

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: