update of cache resources for template function calls in nocache mode

This commit is contained in:
Uwe Tews
2014-11-09 10:20:06 +01:00
parent 223cdc0787
commit adc6091c4d
4 changed files with 81 additions and 0 deletions

View File

@@ -169,6 +169,34 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource
);
}
/**
* Read cached template from cache
*
* @param Smarty_Internal_Template $_template template object
*
* @return string content
*/
public function readCachedContent(Smarty_Internal_Template $_template)
{
$content = $_template->cached->content ? $_template->cached->content : null;
$timestamp = null;
if ($content === null) {
$timestamp = null;
$this->fetch(
$_template->cached->filepath,
$_template->source->name,
$_template->cache_id,
$_template->compile_id,
$content,
$timestamp
);
}
if (isset($content)) {
return $content;
}
return false;
}
/**
* Empty cache
*