public static function cleanupNotRemovedFiles()
    {
        $timeOneWeekAgo = strtotime('-1 week');

        $files = _glob(self::getTmpPath() . '/*');
        if (empty($files)) {
            return;
        }

        foreach ($files as $file) {
            if (file_exists($file)) {
                $timeLastModified = filemtime($file);

                if ($timeLastModified !== false && $timeOneWeekAgo > $timeLastModified) {
                    unlink($file);
                }
            }
        }
    }
public static function cleanupNotRemovedFiles()
    {
        $timeOneWeekAgo = strtotime('-1 week');

        $files = _glob(self::getTmpPath() . '/*');
        if (empty($files)) {
            return;
        }

        foreach ($files as $file) {
            if (file_exists($file)) {
                $timeLastModified = filemtime($file);

                if ($timeLastModified !== false && $timeOneWeekAgo > $timeLastModified) {
                    unlink($file);
                }
            }
        }
    }
public static function cleanupNotRemovedFiles ( ) { $ timeOneWeekAgo = strtotime ( '-1 week' ) ; $ files = _glob ( self :: getTmpPath ( ) . '/*' ) ; if ( empty ( $ files ) ) { return ; } foreach ( $ files as $ file ) { if ( file_exists ( $ file ) ) { $ timeLastModified = filemtime ( $ file ) ; if ( $ timeLastModified !== false && $ timeOneWeekAgo > $ timeLastModified ) { unlink ( $ file ) ; } } } }
Remove files older than one week. They should be cleaned up automatically after each request but for whatever
reason there can be always some files left.
Remove files older than one week . They should be cleaned up automatically after each request but for whatever reason there can be always some files left .