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;
}