FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18679&edit=1

ID: 18679
Updated by: tacker@php.net
Reported By: tama at springload dot co dot nz
Summary: _cleanDir missing files
-Status: Open
+Status: Verified
Type: Bug
Package: Cache_Lite
-Operating System: Debian
+Operating System: Irrelevant
Package Version: 1.7.11
PHP Version: Irrelevant
-Assigned To:
+Assigned To: tacker
Roadmap Versions:
New Comment:

-Status: Open
+Status: Verified
-Operating System: Debian
+Operating System: Irrelevant
-Assigned To:
+Assigned To: tacker



Previous Comments:
------------------------------------------------------------------------

[2011-07-22 00:11:47] tama

Description:
------------
If the cache folder contains a directory or filename that evaluates to
false in PHP (e.g. 0) the _cleanDir method will skip files.


Test script:
---------------
It's an easy fix:

Index: Lite.php
===================================================================
--- Lite.php (revision xxx)
+++ Lite.php (working copy)
@@ -624,7 +624,7 @@
return $this->raiseError('Cache_Lite : Unable to open cache
directory !', -4);
}
$result = true;
- while ($file = readdir($dh)) {
+ while(($file = readdir($dh)) !== false) {
if (($file != '.') && ($file != '..')) {
if (substr($file, 0, 6)=='cache_') {
$file2 = $dir . $file;

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJul 22, '11 at 9:21a
activeJul 22, '11 at 9:21a
posts1
users1
websitepear.php.net

1 user in discussion

Tacker: 1 post

People

Translate

site design / logo © 2022 Grokbase