ZF-7014: Zend_Loader::isReadable finds files related to Zend/Loader.php directory (not only in include_path)
Description
The problem is when I call Zend_Loader::isReadable('Db.php') it will return 'true' even if there are no 'Db.php' files in my include paths. The reason is that fopen('Db.php', 'r', true) searches this file not only in include_path but also in dirname(FILE) of Zend/Loader.php file. So, it finds Zend/Db.php when you're not expecting this.
I think, this is not correct to use 'fopen' in this function. This is my temporary implementation:
public static function isReadable($filename)
{
if (is_readable($filename)) {
return true;
}
foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) {
if (is_readable($path . '/' . $filename)) {
return true;
}
}
return false;
}
Comments
Posted by Ramon Henrique Ornelas (ramon) on 2010-07-16T17:30:18.000+0000
Resolved in version 1.10.1 see r20903.