mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-04 19:54:14 +02:00
update of cache resources for template function calls in nocache mode
This commit is contained in:
@@ -126,6 +126,29 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource
|
||||
return $this->write(array($_template->cached->filepath => $content), $_template->properties['cache_lifetime']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
if (!$this->fetch($_template->cached->filepath, $_template->source->name, $_template->cache_id, $_template->compile_id, $content, $timestamp, $_template->source->uid)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (isset($content)) {
|
||||
return $content;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Empty cache
|
||||
* {@internal the $exp_time argument is ignored altogether }}
|
||||
|
||||
Reference in New Issue
Block a user