本文整理匯總了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;
}