tempDirectories = array( PATH_site . 'typo3temp/scriptmerger/' => 0, PATH_site . 'typo3temp/scriptmerger/temp/' => 0, PATH_site . 'typo3temp/scriptmerger/uncompressed/' => 1209600, PATH_site . 'typo3temp/scriptmerger/compressed/' => 1209600 ); } /** * Clear cache post processor * * This method deletes all temporary files that are older than one month and * if the deletion of the whole cache is requested. * * @param array $params * @return void */ public function clearCachePostProc(&$params) { if ($params['cacheCmd'] !== 'all') { return; } $now = $GLOBALS['EXEC_TIME']; foreach ($this->tempDirectories as $tempDirectory => $maxAge) { if (!is_dir($tempDirectory)) { continue; } $handle = opendir($tempDirectory); while (FALSE !== ($file = readdir($handle))) { if ($file === '.' || $file === '..') { continue; } if (is_file($tempDirectory . $file)) { // get last modification time $lastAccess = fileatime($tempDirectory . $file); $age = $now - $lastAccess; if ($age >= $maxAge) { unlink($tempDirectory . $file); } } } } } } ?>