protected function FileCache::doFlush

Deletes all cache entries.

Return value

boolean TRUE if the cache entry was successfully deleted, FALSE otherwise.

Overrides CacheProvider::doFlush

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Cache/FileCache.php, line 111

Class

FileCache
Base file cache driver.

Namespace

Doctrine\Common\Cache

Code

protected function doFlush() {
  $pattern = '/^.+\\' . $this->extension . '$/i';
  $iterator = new \RecursiveDirectoryIterator($this->directory);
  $iterator = new \RecursiveIteratorIterator($iterator);
  $iterator = new \RegexIterator($iterator, $pattern);
  foreach ($iterator as $name => $file) {
    unlink($name);
  }
  return true;
}