Zend Framework

include_path problem

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Zend_Loader
  • Labels:
    None

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:

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

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
// edit2: error appeared in trunk 9295: * @version $Id: Loader.php 9295 2008-04-23 15:31:51Z yoshida@zend.co.jp $

Issue Links

Activity

Hide
julien PAULI added a comment -

We are on it

Show
julien PAULI added a comment - We are on it
Hide
julien PAULI added a comment -

Fixed in r9300 trunk

Show
julien PAULI added a comment - Fixed in r9300 trunk
Hide
Rafal Piekarski added a comment -

But in my opinion this sollution is incomplete:

Unable to find source-code formatter for language: php. Available languages are: javascript, sql, xhtml, actionscript, none, html, xml, java
if (!file_exists($filename) && !$fh = @fopen($filename, 'r', true)) {

So here is my sollution.

Unable to find source-code formatter for language: php. Available languages are: javascript, sql, xhtml, actionscript, none, html, xml, java
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.

Show
Rafal Piekarski added a comment - But in my opinion this sollution is incomplete:
Unable to find source-code formatter for language: php. Available languages are: javascript, sql, xhtml, actionscript, none, html, xml, java
if (!file_exists($filename) && !$fh = @fopen($filename, 'r', true)) {
So here is my sollution.
Unable to find source-code formatter for language: php. Available languages are: javascript, sql, xhtml, actionscript, none, html, xml, java
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.

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: