예제 #1
0
 /**
  * Returns if the current template must be compiled by the Smarty compiler
  * It does compare the timestamps of template source and the compiled templates and checks the force compile
  * configuration
  *
  * @throws SmartyException
  * @return boolean true if the template must be compiled
  */
 public function mustCompile()
 {
     if (!$this->source->exists) {
         if ($this->parent instanceof Smarty_Internal_Template) {
             $parent_resource = " in '{$this->parent}->template_resource}'";
         } else {
             $parent_resource = '';
         }
         throw new SmartyException("Unable to load template {$this->source->type} '{$this->source->name}'{$parent_resource}");
     }
     if ($this->mustCompile === null) {
         $this->mustCompile = !$this->source->uncompiled && ($this->smarty->force_compile || $this->source->recompiled || !$this->compiled->exists || $this->smarty->compile_check && $this->compiled->getTimeStamp() < $this->source->getTimeStamp());
     }
     return $this->mustCompile;
 }