修复内置模版引擎无法自动获取静态缓存的问题

This commit is contained in:
tale
2016-03-17 23:29:54 +08:00
parent 14ee945b0c
commit 01a3c5aee5
2 changed files with 20 additions and 2 deletions

View File

@@ -169,6 +169,14 @@ class Template
if ($config) {
$this->config($config);
}
if (!empty($this->config['cache_id']) && $this->config['display_cache']) {
// 读取渲染缓存
$cacheContent = Cache::get($this->config['cache_id']);
if ($cacheContent !== false) {
echo $cacheContent;
return;
}
}
$template = $this->parseTemplateFile($template);
if ($template) {
$cacheFile = $this->config['cache_path'] . $this->config['cache_prefix'] . md5($template) . $this->config['cache_suffix'];