summaryrefslogtreecommitdiff
path: root/framework/Caching/TSqliteCache.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Caching/TSqliteCache.php')
-rw-r--r--framework/Caching/TSqliteCache.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/framework/Caching/TSqliteCache.php b/framework/Caching/TSqliteCache.php
index 1ca45863..076b4fce 100644
--- a/framework/Caching/TSqliteCache.php
+++ b/framework/Caching/TSqliteCache.php
@@ -178,6 +178,7 @@ class TSqliteCache extends TCache
*/
protected function setValue($key,$value,$expire)
{
+ $expire=($expire<=0)?0:time()+$expire;
$sql='REPLACE INTO '.self::CACHE_TABLE.' VALUES(\''.$key.'\',\''.sqlite_escape_string($value).'\','.$expire.')';
return $this->_db->query($sql)!==false;
}
@@ -193,6 +194,7 @@ class TSqliteCache extends TCache
*/
protected function addValue($key,$value,$expire)
{
+ $expire=($expire<=0)?0:time()+$expire;
$sql='INSERT INTO '.self::CACHE_TABLE.' VALUES(\''.$key.'\',\''.sqlite_escape_string($value).'\','.$expire.')';
return @$this->_db->query($sql)!==false;
}