mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
修正模板缓存问题
This commit is contained in:
@@ -59,16 +59,16 @@ class File
|
|||||||
*/
|
*/
|
||||||
public function check($templates, $cacheFile, $cacheTime)
|
public function check($templates, $cacheFile, $cacheTime)
|
||||||
{
|
{
|
||||||
if (0 != $cacheTime && time() > filemtime($cacheFile) + $cacheTime) {
|
|
||||||
// 缓存是否在有效期
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
foreach($templates as $time => $path) {
|
foreach($templates as $time => $path) {
|
||||||
if (is_file($path) && filemtime($path) > $time + $cacheTime) {
|
if (is_file($path) && filemtime($path) > $time) {
|
||||||
// 模板文件如果有更新则缓存需要更新
|
// 模板文件如果有更新则缓存需要更新
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (0 != $cacheTime && time() > filemtime($cacheFile) + $cacheTime) {
|
||||||
|
// 缓存是否在有效期
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,17 +76,17 @@ class Sae
|
|||||||
*/
|
*/
|
||||||
public function check($templates, $cacheFile, $cacheTime)
|
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');
|
$mtime = $this->get($cacheFile, 'mtime');
|
||||||
if (0 != $cacheTime && time() > $mtime + $cacheTime) {
|
if (0 != $cacheTime && time() > $mtime + $cacheTime) {
|
||||||
// 缓存是否在有效期
|
// 缓存是否在有效期
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
foreach($templates as $time => $path) {
|
|
||||||
if (is_file($path) && filemtime($path) > $time + $cacheTime) {
|
|
||||||
// 模板文件如果有更新则缓存需要更新
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user