From f33497b304b5b1ab26e9b18b141f755bd97fc9c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 12 Sep 2008 12:22:51 +0000 Subject: [PATCH] RDF cache garbage collector does no longer kill MXChange cache files --- inc/databases.php | 2 +- inc/rdf.class.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index ad211969f3..28f1bb9154 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -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); diff --git a/inc/rdf.class.php b/inc/rdf.class.php index 350976fde6..beaf027feb 100644 --- a/inc/rdf.class.php +++ b/inc/rdf.class.php @@ -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(); -- 2.39.5