mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
修正模板缓存问题
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user