From 8a03692db51a52395e6eb5cc0f3c38493c066ce6 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 28 Mar 2013 21:43:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Template=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Think/Template.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Think/Template.php b/Think/Template.php index f41cb0e5..6945a011 100644 --- a/Think/Template.php +++ b/Think/Template.php @@ -57,9 +57,7 @@ class Template { $this->config['taglib_end'] = $this->stripPreg($this->config['taglib_end']); $this->config['tpl_begin'] = $this->stripPreg($this->config['tpl_begin']); $this->config['tpl_end'] = $this->stripPreg($this->config['tpl_end']); - if($this->config['display_cache']) { - Cache::connect($this->config['cache_options']); - } + // 初始化模板编译存储器 $class = '\Think\Template\Driver\\'.$this->config['compile_type']; $this->storage = new $class(); @@ -124,7 +122,7 @@ class Template { ob_start(); ob_implicit_flush(0); // 读取编译存储 - $this->storage->read($cacheFile); + $this->storage->read($cacheFile,$this->tVar); // 获取并清空缓存 $content = ob_get_clean(); if($cacheId && $this->config['display_cache']) { @@ -150,7 +148,7 @@ class Template { $this->compiler($content,$cacheFile); } // 读取编译存储 - $this->storage->read($cacheFile); + $this->storage->read($cacheFile,$this->tVar); } /**