ZF-11699: Zend_Loader::isReadable creates incorrect paths and then throws warnings
In vhost file for site I have php_admin_value open_basedir "/opt/fed/lib:/opt/fed/options:/usr/share/pear:/usr/share/php"
I add include paths for /opt/fed/lib ( Zend and Company Core libs ) /opt/fed/options/library ( application specific library )
include path already has /usr/share/pear and /usr/share/php
If I run site with PHP error reporting set to include warnings I get a load of them on the page.
here is one: Warning: is_readable(): open_basedir restriction in effect. File(/usr/share/pear//opt/fed/lib/FED/Application/Resource/Frontcontroller.php) is not within the allowed path(s): (/opt/fed/lib:/opt/fed/options:/usr/share/pear:/usr/share/php) in /opt/fed/lib/Zend/Loader.php on line 198 Warning: is_readable(): open_basedir restriction in effect.
The culprit is at about L198 of Zend_Loader and I see a couple of things happening a/ the $file = $path . '/' . $filename; on L197 is creating rubbish paths. In the above example /usr/share/pear/ is part of include paths /opt/fed/lib is part of include paths and in the open_basedir directive L197 (irrespective of the fact that it is creating a none existant path, is not taking care to strip any trailing slashes from $path.
I saw the comments in another ticket about not being able to use PHP5.3 functionality for the V1.X branch and understand that but wouldn't it be better to put if (file_exists($path)) .... at L198 to prevent teh is_readable() warnings.?