改进一处引用传值

This commit is contained in:
thinkphp
2015-12-26 12:06:43 +08:00
parent d3c293bdb1
commit bd322b82e5

View File

@@ -153,9 +153,9 @@ class Template
$template = $this->parseTemplateFile($template); $template = $this->parseTemplateFile($template);
$cacheFile = $this->config['cache_path'] . $this->config['cache_prefix'] . md5($template) . $this->config['cache_suffix']; $cacheFile = $this->config['cache_path'] . $this->config['cache_prefix'] . md5($template) . $this->config['cache_suffix'];
if (!$this->checkCache($template, $cacheFile)) { if (!$this->checkCache($template, $cacheFile)) {
// 缓存无效 // 缓存无效 重新模板编译
// 模板编译 $content = file_get_contents($template);
$this->compiler(file_get_contents($template), $cacheFile); $this->compiler($content, $cacheFile);
} }
// 页面缓存 // 页面缓存
ob_start(); ob_start();
@@ -185,8 +185,7 @@ class Template
} }
$cacheFile = $this->config['cache_path'] . $this->config['cache_prefix'] . md5($content) . $this->config['cache_suffix']; $cacheFile = $this->config['cache_path'] . $this->config['cache_prefix'] . md5($content) . $this->config['cache_suffix'];
if (!$this->checkCache($content, $cacheFile)) { if (!$this->checkCache($content, $cacheFile)) {
// 缓存无效 // 缓存无效 模板编译
// 模板编译
$this->compiler($content, $cacheFile); $this->compiler($content, $cacheFile);
} }
// 读取编译存储 // 读取编译存储