X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Frdf.class.php;h=36cda4dd0e26f5c797459455123bfc6a8856c232;hb=963e55ca1ea79e255f235e359cde9f7862191dc5;hp=350976fde67b23b6b3cab9bb9b5c021b46dc4706;hpb=669a59ecfdc7d0c948544536eb552a37e5e1fb3c;p=mailer.git
diff --git a/inc/rdf.class.php b/inc/rdf.class.php
index 350976fde6..36cda4dd0e 100644
--- a/inc/rdf.class.php
+++ b/inc/rdf.class.php
@@ -1162,15 +1162,13 @@ class fase4_rdf {
$dir = dir($this->_cache_dir);
while($file=$dir->read()) {
// Exclude directories
- if (is_file($dir->path.$file) && substr($file, -6, 6) != ".cache") {
+ if (is_file($dir->path.$file) && substr($file, -6, 6) != ".cache" && substr($file, -4, 4) != ".log") {
if(!@unlink($dir->path.$file)) {
- $this->_throw_exception(
- "Unable to unlink ".$dir->path.$file
- ."
Exception at Line: ".__LINE__ );
+ $this->_throw_exception("Unable to unlink ".$dir->path.$file."
\n
\nException at Line: ".__LINE__ );
return false;
- }
- }
- }
+ } // END - if
+ } // END - if
+ } // END - while
$dir->close();
return true;
} // END clear_cache()
@@ -1186,8 +1184,8 @@ class fase4_rdf {
function _cut_string( $string, $str_len = "30" )
{
if(strlen(trim($string))>$str_len) {
- $string = substr( trim($string) , 0, $str_len - 4);
- $string .= " ...";
+ $string = substr( trim($string) , 0, $str_len - 4);
+ $string .= " ...";
}
return $string;
} // END _cut_string()
@@ -1205,9 +1203,9 @@ 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" && substr($file, -4, 4) != ".log" && filemtime($dir->path.$file) <= time() - $this->_refresh ) {
+ @unlink($dir->path.$file);
+ } // END - if
}
$dir->close();
} // END if