if (rand(1, 100) <= $this->gc_probability) {
$dir = dir($this->_cache_dir);
while($file=$dir->read()) {
- if($file!="." AND $file!=".." AND filemtime($dir->path.$file) <= time() - $this->_refresh ) {
- @unlink($dir->path.$file);
+ if (is_file($dir->path.$file) && substr($file, -6, 6) != ".cache" && filemtime($dir->path.$file) <= time() - $this->_refresh ) {
+ @unlink($dir->path.$file);
}
}
$dir->close();