public function TwigEnvironment::needsUpdate

Checks if the compiled template needs an update.

1 call to TwigEnvironment::needsUpdate()
TwigEnvironment::loadTemplate in drupal/core/lib/Drupal/Core/Template/TwigEnvironment.php
Implements Twig_Environment::loadTemplate().

File

drupal/core/lib/Drupal/Core/Template/TwigEnvironment.php, line 38
Definition of Drupal\Core\Template\TwigEnvironment.

Class

TwigEnvironment
A class that defines a Twig environment for Drupal.

Namespace

Drupal\Core\Template

Code

public function needsUpdate($cache_filename, $name) {
  $cid = 'twig:' . $cache_filename;
  $obj = $this->cache_object
    ->get($cid);
  $mtime = isset($obj->data) ? $obj->data : FALSE;
  return $mtime !== FALSE && !$this
    ->isTemplateFresh($name, $mtime);
}