Craft\MinimeeService::deleteExpiredCache PHP Method

deleteExpiredCache() public method

Based on the cache's hashed base, attempts to delete any older versions of same name.
public deleteExpiredCache ( ) : void
return void
    public function deleteExpiredCache()
    {
        MinimeePlugin::log(Craft::t('Minimee is attempting to delete expired caches.'));
        $files = IOHelper::getFiles($this->settings->cachePath);
        foreach ($files as $file) {
            // skip self
            if ($file === $this->makePathToCacheFilename()) {
                continue;
            }
            if (strpos($file, $this->makePathToHashOfCacheBase()) === 0) {
                MinimeePlugin::log(Craft::t('Minimee is attempting to delete file: ') . $file);
                // suppress errors by passing true as second parameter
                IOHelper::deleteFile($file, true);
            }
        }
    }