Issues

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

Issue Type: Bug Created: 2010-04-29T07:22:00.000+0000 Last Updated: 2010-08-21T19:58:40.000+0000 Status: Resolved Fix version(s): - 1.10.1 (10/Feb/10)

Reporter: Tomáš Fejfar (tomas.fejfar@gmail.com) Assignee: Ramon Henrique Ornelas (ramon) Tags: - Zend_Loader

Related issues: Attachments:

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

Posted by Ramon Henrique Ornelas (ramon) on 2010-08-21T19:58:38.000+0000

Resolved in version 1.10.1 see r20903.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts