Issues

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

Resolved in version 1.10.1 see r20903.