Zend Framework

Zend_Loader::isReadable() keeps file handles open

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.0
  • Fix Version/s: 1.5.3
  • Component/s: Zend_Loader
  • Labels:
    None
  • Fix Version Priority:
    Must Have

Description

public static function isReadable($filename)
    {
        if (!$fh = @fopen($filename, 'r', true)) {
            return false;
        }

        return true;
    }

should be changed to

public static function isReadable($filename)
    {
        if (!$fh = @fopen($filename, 'r', true)) {
            return false;
        }
        fclose($fh);
        return true;
    }

to stop open file handles building up with each invocation of the function

Issue Links

Activity

Hide
Wil Sinclair added a comment -

Please categorize/fix as needed.

Show
Wil Sinclair added a comment - Please categorize/fix as needed.
Hide
Satoru Yoshida added a comment -

Hi, Ralph.
If you are OK, Would I fix also this when I would fix ZF-2985 ?

Show
Satoru Yoshida added a comment - Hi, Ralph. If you are OK, Would I fix also this when I would fix ZF-2985 ?
Hide
Ralph Schindler added a comment -

Updating project management info.

Show
Ralph Schindler added a comment - Updating project management info.
Hide
Jens Ljungblad added a comment -

You might want to be sure fclose doesn't fail

public static function isReadable($filename)
{
    if (!$fh = @fopen($filename, 'r', true)) {
        return false;
    }
    return fclose($fh);
}
Show
Jens Ljungblad added a comment - You might want to be sure fclose doesn't fail
public static function isReadable($filename)
{
    if (!$fh = @fopen($filename, 'r', true)) {
        return false;
    }
    return fclose($fh);
}
Hide
Satoru Yoshida added a comment -

I believe it is resolved by ZF-2985

Show
Satoru Yoshida added a comment - I believe it is resolved by ZF-2985
Hide
Jens Ljungblad added a comment -

I don't believe this was fixed

Show
Jens Ljungblad added a comment - I don't believe this was fixed
Hide
Ralph Schindler added a comment -

Fixed in trunk in r10454
Fixed in release 1.5 in r10455
Rixed in release 1.6 in r10456

Show
Ralph Schindler added a comment - Fixed in trunk in r10454 Fixed in release 1.5 in r10455 Rixed in release 1.6 in r10456

People

Vote (1)
Watch (4)

Dates

  • Due:
    Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
1h
Original Estimate - 1 hour
Remaining:
1h
Remaining Estimate - 1 hour
Logged:
Not Specified
Time Spent - Not Specified