0: expires in x days) Zero already checked if ($cacheLife > 0) { $modtime = filemtime($fname); //-- time should start at the beginning of the day $modtime = $modtime - (date("G",$modtime)*60*60 + date("i",$modtime)*60 + date("s",$modtime)); $checktime = ($cacheLife*24*60*60); $modtime = $modtime+$checktime; if ($modtimeread())) { if ($entry == '.' || $entry == '..') continue; $entry = $dir . '/' . $entry; if (is_dir($entry)) { if (!removeDir($entry)) return FALSE; continue; } if (!@unlink($entry)) { $d->close(); return FALSE; } } $d->close(); rmdir($dir); return TRUE; } /** * clears the cache files */ function clearCache() { $INDEX_DIRECTORY=get_site_setting('INDEX_DIRECTORY'); removeDir("{$INDEX_DIRECTORY}/cache"); } ?>