改进模板的编译缓存命名规则 增加布局模板的标识

This commit is contained in:
thinkphp
2017-12-27 14:38:47 +08:00
parent 43aad4fe11
commit 043fa5d6ae

View File

@@ -185,7 +185,7 @@ class Template
}
$template = $this->parseTemplateFile($template);
if ($template) {
$cacheFile = $this->config['cache_path'] . $this->config['cache_prefix'] . md5($template) . '.' . ltrim($this->config['cache_suffix'], '.');
$cacheFile = $this->config['cache_path'] . $this->config['cache_prefix'] . md5($this->config['layout_name'] . $template) . '.' . ltrim($this->config['cache_suffix'], '.');
if (!$this->checkCache($cacheFile)) {
// 缓存无效 重新模板编译
$content = file_get_contents($template);