From d5483426c296a72732364da024443d796f218cd3 Mon Sep 17 00:00:00 2001 From: oldrind <1401019000@qq.com> Date: Sat, 12 Mar 2016 10:08:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=A8=A1=E6=9D=BF=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/template/driver/File.php | 10 +++++----- library/think/template/driver/Sae.php | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/library/think/template/driver/File.php b/library/think/template/driver/File.php index 9d9c9266..54a9efe5 100644 --- a/library/think/template/driver/File.php +++ b/library/think/template/driver/File.php @@ -59,16 +59,16 @@ class File */ public function check($templates, $cacheFile, $cacheTime) { - if (0 != $cacheTime && time() > filemtime($cacheFile) + $cacheTime) { - // 缓存是否在有效期 - return false; - } foreach($templates as $time => $path) { - if (is_file($path) && filemtime($path) > $time + $cacheTime) { + if (is_file($path) && filemtime($path) > $time) { // 模板文件如果有更新则缓存需要更新 return false; } } + if (0 != $cacheTime && time() > filemtime($cacheFile) + $cacheTime) { + // 缓存是否在有效期 + return false; + } return true; } } diff --git a/library/think/template/driver/Sae.php b/library/think/template/driver/Sae.php index e6209303..73aa869a 100644 --- a/library/think/template/driver/Sae.php +++ b/library/think/template/driver/Sae.php @@ -76,17 +76,17 @@ class Sae */ public function check($templates, $cacheFile, $cacheTime) { + foreach($templates as $time => $path) { + if (is_file($path) && filemtime($path) > $time) { + // 模板文件如果有更新则缓存需要更新 + return false; + } + } $mtime = $this->get($cacheFile, 'mtime'); if (0 != $cacheTime && time() > $mtime + $cacheTime) { // 缓存是否在有效期 return false; } - foreach($templates as $time => $path) { - if (is_file($path) && filemtime($path) > $time + $cacheTime) { - // 模板文件如果有更新则缓存需要更新 - return false; - } - } return true; }