Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.2
-
Fix Version/s: 1.10.1
-
Component/s: Zend_Loader
-
Labels:None
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; }
Issue Links
| This issue duplicates: | ||||
| ZF-6833 | Zend_Loader::isReadable() returns false when valid file is in same directory but . is not in include_path |
|
|
|
Resolved in version 1.10.1 see r20903.