本文整理汇总了PHP中Smarty_Resource::populateCompiledFilepath方法的典型用法代码示例。如果您正苦于以下问题:PHP Smarty_Resource::populateCompiledFilepath方法的具体用法?PHP Smarty_Resource::populateCompiledFilepath怎么用?PHP Smarty_Resource::populateCompiledFilepath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Smarty_Resource
的用法示例。
在下文中一共展示了Smarty_Resource::populateCompiledFilepath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCompiled
/**
* 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;
}
示例2: getCompiled
/**
* 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;
}
示例3: getCompiled
/**
* 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;
}
示例4: getCompiled
/**
* 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;
}