ZF-3170: include_path problem

Issue Type: Bug Created: 2008-04-23T20:34:29.000+0000 Last Updated: 2008-05-14T04:46:19.000+0000 Status: Resolved Fix version(s): Reporter: Alexander Lanin (alexl) Assignee: Wil Sinclair (wil) Tags: - Zend_Loader

Related issues: - ZF-2985



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:

<pre class="highlight">    /**
     * 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 $


Posted by julien PAULI (doctorrock83) on 2008-04-24T03:08:57.000+0000

We are on it ;-)

Posted by julien PAULI (doctorrock83) on 2008-04-24T08:17:54.000+0000

Fixed in r9300 trunk

Posted by Rafal Piekarski (ravbaker) on 2008-04-25T00:58:56.000+0000

But in my opinion this sollution is incomplete:

<pre class="highlight">
if (!file_exists($filename) && !$fh = @fopen($filename, 'r', true)) {

So here is my sollution.

<pre class="highlight">
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.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.