mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 02:14:26 +02:00
change behavior so cache_lifetime = 0 never expires (instead of always regenerate)
This commit is contained in:
@@ -1411,8 +1411,8 @@ function _run_insert_handler($args)
|
|||||||
{
|
{
|
||||||
static $content_cache = array();
|
static $content_cache = array();
|
||||||
|
|
||||||
if ($this->force_compile || $this->cache_lifetime == 0) {
|
if ($this->force_compile) {
|
||||||
// force compile enabled or cache lifetime is zero, always regenerate
|
// force compile enabled, always regenerate
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1446,7 +1446,7 @@ function _run_insert_handler($args)
|
|||||||
|
|
||||||
$this->_cache_info = unserialize($cache_header);
|
$this->_cache_info = unserialize($cache_header);
|
||||||
|
|
||||||
if (time() - $this->_cache_info['timestamp'] > $this->cache_lifetime) {
|
if ($this->cache_lifetime < 0 && (time() - $this->_cache_info['timestamp'] > $this->cache_lifetime)) {
|
||||||
// cache expired, regenerate
|
// cache expired, regenerate
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -1411,8 +1411,8 @@ function _run_insert_handler($args)
|
|||||||
{
|
{
|
||||||
static $content_cache = array();
|
static $content_cache = array();
|
||||||
|
|
||||||
if ($this->force_compile || $this->cache_lifetime == 0) {
|
if ($this->force_compile) {
|
||||||
// force compile enabled or cache lifetime is zero, always regenerate
|
// force compile enabled, always regenerate
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1446,7 +1446,7 @@ function _run_insert_handler($args)
|
|||||||
|
|
||||||
$this->_cache_info = unserialize($cache_header);
|
$this->_cache_info = unserialize($cache_header);
|
||||||
|
|
||||||
if (time() - $this->_cache_info['timestamp'] > $this->cache_lifetime) {
|
if ($this->cache_lifetime < 0 && (time() - $this->_cache_info['timestamp'] > $this->cache_lifetime)) {
|
||||||
// cache expired, regenerate
|
// cache expired, regenerate
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user