Issues

ZF-3170: include_path problem

Description

I just did an svn update and out of the blue the only thing I was seeing on my site was: Action Helper by name ViewRenderer not found

After some checking i found this code in Zend_Loader:

    /**
     * Returns TRUE if the $filename is readable, or FALSE otherwise.
     * This function uses the PHP include_path, where PHP's is_readable()
     * does not.
     *
     * @param string   $filename
     * @return boolean
     */
    public static function isReadable($filename)
    {
        if (!file_exists($filename) || !$fh = @fopen($filename, 'r', true)) {
            return false;
        }

        return true;
    }

I fixed it to: ``` because if fopen can open the file, than it IS readable => return true

this way I got rid of the error mentioned above.

// edit: submited it too fast :D // edit2: error appeared in trunk 9295: * @version $Id: Loader.php 9295 2008-04-23 15:31:51Z yoshida@zend.co.jp $

Comments

We are on it ;-)

Fixed in r9300 trunk

But in my opinion this sollution is incomplete:


if (!file_exists($filename) && !$fh = @fopen($filename, 'r', true)) {

So here is my sollution.


if (!file_exists($filename) || file_exists($filename) && !$fh = @fopen($filename, 'r', true)) {

Brackets outside && are optional.

What do you think?

Because I've tested it in my application and it works.