Bluz\Cache\Adapter\FileBase::doFlush PHP Method

doFlush() protected method

Flush implementation for all file-based cache implementations
protected doFlush ( ) : boolean
return boolean
    protected function doFlush()
    {
        // copypaste from Doctrine\Common\Cache\FileCache.
        $pattern = '/^.+\\' . $this->extension . '$/i';
        $iterator = new \RecursiveDirectoryIterator($this->cacheDir);
        $iterator = new \RecursiveIteratorIterator($iterator);
        $iterator = new \RegexIterator($iterator, $pattern);
        foreach ($iterator as $name => $file) {
            @unlink($name);
        }
        return true;
    }