Manually clean out entries older than their TTL

@return bool Returns true if the cache directory was cleaned.
179694
public function clean()
    {
        if (!($files = $this->getCacheFiles())) {
            return false;
        }

        foreach ($files as $file) {
            $key = basename($file, $this->extension);
            $this->get($key); // Automatically deletes if expired
        }
        return true;
    }
1305714
public function clear()
    {
        foreach ($this->filesystem()->listContents() as $file) {
            $this->filesystem()->delete($file['path']);
        }

        return true;
    }
97043
public static function clear()
    {
        $isClearAll = true;
        if ($_COOKIE) {
            foreach ($_COOKIE as $key => $value) {
                $result = self::delete($key);
                if (!$result) {
                    $isClearAll = false;
                }
            }
        }
        return $isClearAll;
    }
558678
public function clear()
    {
        $result = true;

        foreach (glob("{$this->path}/*.cache") as $filename) {
            if (!unlink($filename)) {
                $result = false;
            }
        }

        return $result;
    }
677162
public function clear()
    {
        if (empty($this->tags)) {
            return false;
        }

        return $this->cacheFrontend->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, $this->tags);
    }
1038246
public function clear() {
		if ( ! $this->enabled ) {
			return false;
		}

		$finder = $this->get_finder();

		foreach ( $finder as $file ) {
			unlink( $file->getRealPath() );
		}

		return true;
	}
306272
public function deleteOutdated(): bool
    {
        $keys = $this->db->keys('*');
        foreach ($keys as $key) {
            try {
                $packet = $this->getPacket($key);
                if ($packet->outdated()) {
                    $this->delete($key);
                }
            } catch (BadPacketException $e) {
                $this->delete($key);
            }
        }
        return true;
    }
383737
public function cleanup()
    {
        // Find all files older than the given gc age
        $fileIds = File::query()
            ->where('created_at', '<', Carbon::now()->subMinutes($this->getGarbageAgeInMinutes()))
            ->pluck('id');

        if ( ! count($fileIds)) {
            return 0;
        }

        $success = 0;

        foreach ($fileIds as $fileId) {
            $success += (int) $this->delete($fileId);
        }

        return $success;
    }
869648
function isCached()
    {
        $file = $this->cache_dir . '/' . base64_encode($_SERVER['REQUEST_URI']) . '.html';
        if (!file_exists($file))
        {
            return false;
        }
        elseif (filemtime($file) + $this->expire < time())
        {
            return false;
        }
        else
        {
            return true;
        }
    }
507891
public function flush()
    {
        if (! $this->files->isDirectory($this->directory)) {
            return false;
        }

        foreach ($this->files->directories($this->directory) as $directory) {
            if (! $this->files->deleteDirectory($directory)) {
                return false;
            }
        }

        return true;
    }
1276857
protected function doExecute()
    {
        $folders = $this->io->getArguments();

        if (!count($folders)) {
            $this->clearCacheRoot();
        } else {
            foreach ($folders as $folder) {
                $this->clearCacheFolder($folder);
            }
        }

        $this->out('Cache cleared.');

        return true;
    }
954427
public function clear()
    {
        $session = $this->getSessionContainer();
        if (!$session->isSwitchedUser) {
            return false;
        }

        $oldSession = unserialize($session->session);
        $ref        = $session->ref;
        $_SESSION = $oldSession;

        return $ref ? $ref : true;
    }
359617
public static function flush()
    {
        $instance = self::getInstance();
        $glob = @glob(self::cacheDir() . $instance->_options['file_name_prefix'] . '--*');

        if (empty($glob)) {
            return false;
        }

        foreach ($glob as $v) {
            $fileName = basename($v);
            $id = $instance->_fileNameToId($fileName);
            $instance->delete($id);
        }
        return true;
    }
1125469
public function clearExpired()
    {
        if (! $this->enabled) {
            return;
        }
        $error = false;

        set_error_handler(function () use (&$error) {
            $error = true;
        }, E_WARNING);
        foreach (glob($this->getPath() . '/*.dat') as $file) {
            if (filemtime($file) < time()) {
                unlink($file);
            }
        }
        restore_error_handler();

        return ! $error;
    }
1041928
public function clear()
    {
        $patternKey = $this->fixKey('*');
        $list = glob($patternKey);
        foreach ($list as $file) {
            unlink($file);
        }
        return true;
    }
992949
public function clear()
    {
        $keys = self::$instance->keys($this->options['prefix'].'*');
        if ($keys) {
            self::$instance->del(...$keys);
        }

        return true;
    }
248035
public function isClean()
    {
        if ($this->getConfigFileAge() > max($this->getSassMaxAge(), $this->getStylesheetsMaxAge())) {
            return false;
        }

        return $this->getSassMaxAge() <= $this->getStylesheetsMaxAge();
    }