コード例 #1
0
 /**
  * get a Compiled Object of this source
  *
  * @param  Smurty_Internal_Template|Smurty_Internal_Config $_template template object
  *
  * @return Smurty_Template_Compiled compiled object
  */
 public function getCompiled($_template)
 {
     // check runtime cache
     $_cache_key = $this->unique_resource . '#' . $_template->compile_id;
     if (isset(Smurty_Resource::$compileds[$_cache_key])) {
         return Smurty_Resource::$compileds[$_cache_key];
     }
     $compiled = new Smurty_Template_Compiled($this);
     $this->handler->populateCompiledFilepath($compiled, $_template);
     $compiled->timestamp = @filemtime($compiled->filepath);
     $compiled->exists = !!$compiled->timestamp;
     // runtime cache
     Smurty_Resource::$compileds[$_cache_key] = $compiled;
     return $compiled;
 }