You are here

public function Twig_Environment::clearCacheFiles in Zircon Profile 8

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

Clears the template cache files on the filesystem.

Deprecated

since 1.22 (to be removed in 2.0)

File

vendor/twig/twig/lib/Twig/Environment.php, line 528

Class

Twig_Environment
Stores the Twig configuration.

Code

public function clearCacheFiles() {
  @trigger_error(sprintf('The %s method is deprecated and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
  if (is_string($this->originalCache)) {
    foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->originalCache), RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
      if ($file
        ->isFile()) {
        @unlink($file
          ->getPathname());
      }
    }
  }
}