2008年11月4日星期二

[fw-core] Zend_Loader::isReadable fix

I'm getting annoyed by the errors the isReadable function gives because it's
trying to open non-existing files (which get suppressed).
Why not use file_exists in conjuction with file_open? It won't give (as
many) errors with the same implementation.

There was an alternative fix, but it got revert because it broke the BC
(which is what?).

SO:

public static function isReadable($filename)
{
if (!file_exists($filename) || !$fh = @fopen($filename, 'r', true))
{
return false;
}
@fclose($fh);
return true;
}
--
View this message in context: http://www.nabble.com/Zend_Loader%3A%3AisReadable-fix-tp20326421p20326421.html
Sent from the Zend Core mailing list archive at Nabble.com.

没有评论: