X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Frdf.class.php;h=51c32088214f37b849f06f5b595e4adc5f72578b;hp=beaf027feb99179938c2f5aec14eabba8e503833;hb=508228c85fba8448d00865b1639cb8cd7a69e457;hpb=f33497b304b5b1ab26e9b18b141f755bd97fc9c1 diff --git a/inc/rdf.class.php b/inc/rdf.class.php index beaf027feb..51c3208821 100644 --- a/inc/rdf.class.php +++ b/inc/rdf.class.php @@ -1,5 +1,5 @@ -* @version 1.7 ($Date: 2003/07/06 20:33:58 $) $Revision: 1.40 $ +* @author Roland Haeder +* @version 1.7 ($Date$Revision: 856 $ * @access public */ @@ -1162,15 +1163,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 +1185,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() @@ -1202,12 +1201,12 @@ class fase4_rdf { function _garbage_collection() { srand((double) microtime() * 1000000); - if (rand(1, 100) <= $this->gc_probability) { + if (mt_rand(1, 100) <= $this->gc_probability) { $dir = dir($this->_cache_dir); while($file=$dir->read()) { - if (is_file($dir->path.$file) && substr($file, -6, 6) != ".cache" && 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 @@ -1357,6 +1356,7 @@ class fase4_rdf { fputs($fp, $request); $reply = ""; $isContent = false; $dummy = ""; // Read reply + $i=0; while ( !feof($fp) ) { $read = trim(fgets($fp, 4096)); if (substr($read, 0, 5) == "