RDF cache garbage collector does no longer kill MXChange cache files
authorRoland Häder <roland@mxchange.org>
Fri, 12 Sep 2008 12:22:51 +0000 (12:22 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 12 Sep 2008 12:22:51 +0000 (12:22 +0000)
inc/databases.php
inc/rdf.class.php

index ad21196..28f1bb9 100644 (file)
@@ -114,7 +114,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "307");
+define('CURR_SVN_REVISION', "308");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 350976f..beaf027 100644 (file)
@@ -1205,8 +1205,8 @@ class fase4_rdf {
         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();