mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
- enhancement an expire_time of -1 in clearCache() and clearAllCache() will delete outdated cache files
by their individual cache_lifetime used at creation (forum topic 24310)
This commit is contained in:
@@ -1,4 +1,8 @@
|
|||||||
===== trunk =====
|
===== trunk =====
|
||||||
|
26.05.2013
|
||||||
|
- enhancement an expire_time of -1 in clearCache() and clearAllCache() will delete outdated cache files
|
||||||
|
by their individual cache_lifetime used at creation (forum topic 24310)
|
||||||
|
|
||||||
21.05.2013
|
21.05.2013
|
||||||
- bugfix modifier strip_tags:true was compiled into wrong code (Forum Topic 24287)
|
- bugfix modifier strip_tags:true was compiled into wrong code (Forum Topic 24287)
|
||||||
- bugfix /n after ?> in Smarty.class.php did start output buffering (Issue 138)
|
- bugfix /n after ?> in Smarty.class.php did start output buffering (Issue 138)
|
||||||
|
@@ -210,9 +210,18 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// expired ?
|
// expired ?
|
||||||
if (isset($exp_time) && $_time - @filemtime($_file) < $exp_time) {
|
if (isset($exp_time)) {
|
||||||
|
if ($exp_time < 0) {
|
||||||
|
preg_match('#\'cache_lifetime\' =>\s*(\d*)#', file_get_contents($_file), $match);
|
||||||
|
if ($_time < (@filemtime($_file) + $match[1])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if ($_time - @filemtime($_file) < $exp_time) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$_count += @unlink((string) $_file) ? 1 : 0;
|
$_count += @unlink((string) $_file) ? 1 : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user