$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
- ."<br /><br />Exception at Line: ".__LINE__ );
+ $this->_throw_exception("Unable to unlink ".$dir->path.$file."<br />\n<br />\nException at Line: ".__LINE__ );
return false;
- }
- }
- }
+ } // END - if
+ } // END - if
+ } // END - while
$dir->close();
return true;
} // END clear_cache()
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()
if (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