public function Twig_Environment::isTemplateFresh

Returns true if the template is still fresh.

Besides checking the loader for freshness information, this method also checks if the enabled extensions have not changed.

Parameters

string $name The template name:

timestamp $time The last modification time of the cached template:

Return value

Boolean true if the template is fresh, false otherwise

1 call to Twig_Environment::isTemplateFresh()
Twig_Environment::loadTemplate in drupal/core/vendor/twig/twig/lib/Twig/Environment.php
Loads a template by name.

File

drupal/core/vendor/twig/twig/lib/Twig/Environment.php, line 356

Class

Twig_Environment
Stores the Twig configuration.

Code

public function isTemplateFresh($name, $time) {
  foreach ($this->extensions as $extension) {
    $r = new ReflectionObject($extension);
    if (filemtime($r
      ->getFileName()) > $time) {
      return false;
    }
  }
  return $this->loader
    ->isFresh($name, $time);
}