You are here

public function Twig_Environment::isTemplateFresh in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Environment.php \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

bool true if the template is fresh, false otherwise

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

File

vendor/Twig/Environment.php, line 360

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
    ->getLoader()
    ->isFresh($name, $time);
}