Just curious
$files = glob(cacheme_directory().\"*\");
foreach($files as $file)
{
$filemtime=filemtime ($file);
I reckon this is much tidier and easier to read and modify.
$expire = strtotime('-7 DAYS');
$files = glob($path . '/*');
foreach ($files as $file) {
// Skip anything that is not a file
if (!is_file($file)) {
continue;
}
// Skip any files that have not expired
if (filemtime($file) > $expire) {
continue;
}
unlink($file);
}