ZF-7063: Zend_Loader_Autoloader::getClassAutoloaders() incorrectly detects module namespaces...
Description
My application is structured as follows...
application modules admin sales sales-admin
In Zend_Loader_Autoloader (line 308), it detects the namespace incorrectly and returns the wrong autoloader for all classes in sales-admin (instead bringing back those from Sales.
Proposed fix is to replace line 308 if (0 === strpos($class, $ns)) {
with the following if (0 === strpos($class, $ns.'_')) {
This seems to fix things, but I'm not entirely sure if that's going to cover it... maybe a little regex would be more helpful...
Comments
Posted by Ben Fox (wildfoxmedia) on 2009-07-14T01:18:37.000+0000
I would just like to add that I am having the same issue with 2 modules/namespaces of my own.
news & news-aggregator
Posted by Hinikato Dubrai (hinikato) on 2009-08-20T16:45:33.000+0000
Yes, I have the same problem too. If two modules begin with the same prefix, then Zend_Loader_Autoloader will return invalid result.
For example, if we have "foo" module and "foo-bar" module, Zend_Loader_Autoloader will return autoloaders for the first module ("foo").
Posted by Hinikato Dubrai (hinikato) on 2009-08-20T17:12:40.000+0000
This is bug example:
Posted by Matthew Weier O'Phinney (matthew) on 2009-08-21T04:30:19.000+0000
This was fixed for 1.9.1 (see ZF-7473)