/**
  * get a Compiled Object of this source
  *
  * @param Smarty_Internal_Template $_template template objet
  * @return Smarty_Template_Compiled compiled object
  */
 public function getCompiled(Smarty_Internal_Template $_template)
 {
     // check runtime cache
     $_cache_key = $this->unique_resource . '#' . $_template->compile_id;
     if (isset(Smarty_Resource::$compileds[$_cache_key])) {
         return Smarty_Resource::$compileds[$_cache_key];
     }
     $compiled = new Smarty_Template_Compiled($this);
     $this->handler->populateCompiledFilepath($compiled, $_template);
     if (file_exists($compiled->filepath)) {
         $compiled->timestamp = @filemtime($compiled->filepath);
     } else {
         $compiled->timestamp = FALSE;
     }
     $compiled->exists = !!$compiled->timestamp;
     // runtime cache
     Smarty_Resource::$compileds[$_cache_key] = $compiled;
     return $compiled;
 }
 /**
  * get a Compiled Object of this source
  *
  * @param Smarty_Internal_Template $_template template objet
  * @return Smarty_Template_Compiled compiled object
  */
 public function getCompiled(Smarty_Internal_Template $_template)
 {
     $compiled = new Smarty_Template_Compiled($this);
     $this->handler->populateCompiledFilepath($compiled, $_template);
     $compiled->timestamp = @filemtime($compiled->filepath);
     $compiled->exists = !!$compiled->timestamp;
     return $compiled;
 }
Beispiel #3
0
 /**
  * get a Compiled Object of this source
  *
  * @param Smarty_Internal_Template $_template template objet
  * @return Smarty_Template_Compiled compiled object
  */
 public function getCompiled(Smarty_Internal_Template $_template)
 {
     // check runtime cache
     $_cache_key_dir = $_template->smarty->joined_template_dir;
     $_cache_key = $_template->template_resource . '#' . $_template->compile_id;
     if (!isset(Smarty_Resource::$compileds[$_cache_key_dir])) {
         Smarty_Resource::$compileds[$_cache_key_dir] = array();
     }
     if (isset(Smarty_Resource::$compileds[$_cache_key_dir][$_cache_key])) {
         return Smarty_Resource::$compileds[$_cache_key_dir][$_cache_key];
     }
     $compiled = new Smarty_Template_Compiled($this);
     $this->handler->populateCompiledFilepath($compiled, $_template);
     $compiled->timestamp = @filemtime($compiled->filepath);
     $compiled->exists = !!$compiled->timestamp;
     // runtime cache
     Smarty_Resource::$compileds[$_cache_key_dir][$_cache_key] = $compiled;
     return $compiled;
 }
Beispiel #4
0
 /**
  * get a Compiled Object of this source
  *
  * @param Smarty_Internal_Template $_template template objet
  * @return Smarty_Template_Compiled compiled object
  */
 public function getCompiled(Smarty_Internal_Template $_template)
 {
     // check runtime cache
     $_cache_key_dir = join(DIRECTORY_SEPARATOR, $_template->smarty->getTemplateDir());
     $_cache_key = $_template->template_resource . '#' . $_template->compile_id;
     if (!isset(Smarty_Resource::$compileds[$_cache_key_dir])) {
         Smarty_Resource::$compileds[$_cache_key_dir] = array();
     }
     if (isset(Smarty_Resource::$compileds[$_cache_key_dir][$_cache_key])) {
         return Smarty_Resource::$compileds[$_cache_key_dir][$_cache_key];
     }
     $compiled = new Smarty_Template_Compiled($this);
     $this->handler->populateCompiledFilepath($compiled, $_template);
     Smarty::muteExpectedErrors();
     $compiled->timestamp = @filemtime($compiled->filepath);
     Smarty::unmuteExpectedErrors();
     $compiled->exists = !!$compiled->timestamp;
     // runtime cache
     Smarty_Resource::$compileds[$_cache_key_dir][$_cache_key] = $compiled;
     return $compiled;
 }