mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user