You are here

public function Twig_Environment::clearCacheFiles in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Environment.php \Twig_Environment::clearCacheFiles()

Clears the template cache files on the filesystem.

File

vendor/Twig/Environment.php, line 420

Class

Twig_Environment
Stores the Twig configuration.

Code

public function clearCacheFiles() {
  if (false === $this->cache) {
    return;
  }
  foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->cache), RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
    if ($file
      ->isFile()) {
      @unlink($file
        ->getPathname());
    }
  }
}