Home » Logging » Log » Bug #9388
File Log doesn't check file point
Details
| Submitted | 2006-11-19 21:26 UTC |
|---|---|
| From | derek at battams dot ca |
| Assigned | jon |
| Status | Closed |
| Package | Log |
| PHP Version | Irrelevant |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2006-11-19 21:26 UTC] derek at battams dot ca
Description:
------------
Log/file.php:
The flush() method assumes that the member file pointer is always valid - this isn't true if the log hasn't been written to, but a flush is attempted.
Test script:
---------------
Suggested patch for the flush method:
function flush()
{
if(is_resource($this->_fp))
$ret = fflush($this->_fp);
else
$ret = true;
return $ret;
}
Expected result:
----------------
No PHP warning.
Actual result:
--------------
Warning: fflush(): supplied argument is not a valid stream resource in /usr/lib/php/Log/file.php on line 253