ZF-9767: Zend_Loader_PluginLoader will fail with custom plugins in Controller/Action/Helper/

Description

Zend_Loader_PluginLoader uses the Zend_Loader::isReadable() method. It uses @fopen($filename) to see if file exists, with third parameter set to true (=use include_path).

The "/library/Zend/" folder is not in include path (only "/library/" is). But when itteration over include paths ends, the fopen() function tries current folder (which is /library/Zend/"). And when the path is same as Zend path (=Controller/Action/Helper/) the class gets resolved. And Zend_Loader::isReadable() returns true.

The value is recieved in Zend_Loader_PluginLoader. Because the file was readable Zend_Loader_PluginLoader tries to include it. But because the include doesn't work with current folder (unless present in include path), and even if it would... current folder is "/library/Zend/Loader/" and not "/library/Zend/" anymore.

Warning is emited from the include call.

Fix for this is different user naming conventions for classes loaded by pluginloader or prefixing them with My_ etc.. I couldn't come up with patch, that would stop this behaviour except using is_readable with include paths in foreach, which was told to be extremly slow and not to be implemented.

But at least there should be a warning in manual that you shouldn't name your classes like that.

Comments

Resolved in version 1.10.1 see r20903.