From dfd1f499fb191ec287cf671153185f163d0736d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=9F=E5=B8=85=E5=B9=B2?= Date: Thu, 12 May 2016 18:05:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E7=BC=93=E5=AD=98=E6=98=AF=E5=90=A6=E6=9C=89?= =?UTF-8?q?=E6=95=88=20=E6=96=B9=E6=B3=95bug,=20=E5=85=88=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E7=BC=93=E5=AD=98=E6=96=87=E4=BB=B6=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8,=20=E5=A6=82=E6=9E=9C=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E8=80=8C=E7=9B=B4=E6=8E=A5=E8=B0=83?= =?UTF-8?q?=E7=94=A8filemtime=E4=BC=9A=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/template/driver/File.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/think/template/driver/File.php b/library/think/template/driver/File.php index c369390e..bfb2787d 100644 --- a/library/think/template/driver/File.php +++ b/library/think/template/driver/File.php @@ -52,13 +52,16 @@ class File /** * 检查编译缓存是否有效 - * @array $templates 用到的模板文件及更新时间列表 * @string $cacheFile 缓存的文件名 * @int $cacheTime 缓存时间 * @return boolean */ public function check($cacheFile, $cacheTime) { + // 缓存文件不存在, 直接返回false + if (!file_exists($cacheFile)) { + return false; + } if (0 != $cacheTime && time() > filemtime($cacheFile) + $cacheTime) { // 缓存是否在有效期 return false;