Hello together,
I experienced a problem with Zend_Loader in the new ZF release. With the new
release ZF does not found the initial Viewhelpers. It searches first in the
application\views\helpers and not in the Zend\View\Helper directory. I got
following error message:
exception 'My_ErrorhandlerException' with message
'fopen(..\application\views\helpers\Url.php) [<a
href='function.fopen'>function.fopen</a>]: failed to open stream: No such file
or directory' in D:\www\library\Zend\Loader.php:194
The problem seems to be related with the new Zend_Loader::isReadable($filename)
method. If I replace the code of this method with the old code from the ZF
v1.0.2 it works fine. I guess the problem is the @ before fopen, it does not
suppress the error in E_ALL|E_STRICT mode. The function is_readable() was
better, because it throws no error and returns only false or true.
// NEW CODE FROM ZF 1.0.3:
public static function isReadable($filename)
{
if (!$fh = @fopen($filename, 'r', true)) {
return false;
}
return true;
}
// OLD CODE FROM ZF 1.0.2:
public static function isReadable($filename)
{
if (@is_readable($filename)) {
return true;
}
$path = get_include_path();
$dirs = explode(PATH_SEPARATOR, $path);
foreach ($dirs as $dir) {
// No need to check against current dir -- already checked
if ('.' == $dir) {
continue;
}
if (@is_readable($dir . DIRECTORY_SEPARATOR . $filename)) {
return true;
}
}
return false;
}
Best regards
Sascha
__________________________________________________________________________
Erweitern Sie FreeMail zu einem noch leistungsstärkeren E-Mail-Postfach!
Mehr Infos unter http://produkte.web.de/club/?mc=021131