From 6b38793c22293da6880578628c6f4e8e8a6bddbf Mon Sep 17 00:00:00 2001 From: mohrt Date: Sat, 2 Mar 2002 07:26:02 +0000 Subject: [PATCH] change behavior so cache_lifetime = 0 never expires (instead of always regenerate) --- Smarty.class.php | 6 +++--- libs/Smarty.class.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Smarty.class.php b/Smarty.class.php index 3d882caa..e8878243 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -1411,8 +1411,8 @@ function _run_insert_handler($args) { static $content_cache = array(); - if ($this->force_compile || $this->cache_lifetime == 0) { - // force compile enabled or cache lifetime is zero, always regenerate + if ($this->force_compile) { + // force compile enabled, always regenerate return false; } @@ -1446,7 +1446,7 @@ function _run_insert_handler($args) $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 return false; } diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 3d882caa..e8878243 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1411,8 +1411,8 @@ function _run_insert_handler($args) { static $content_cache = array(); - if ($this->force_compile || $this->cache_lifetime == 0) { - // force compile enabled or cache lifetime is zero, always regenerate + if ($this->force_compile) { + // force compile enabled, always regenerate return false; } @@ -1446,7 +1446,7 @@ function _run_insert_handler($args) $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 return false; }