diff options
Diffstat (limited to 'framework/Caching/TSqliteCache.php')
-rw-r--r-- | framework/Caching/TSqliteCache.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/framework/Caching/TSqliteCache.php b/framework/Caching/TSqliteCache.php index 4a1aa615..d4308e64 100644 --- a/framework/Caching/TSqliteCache.php +++ b/framework/Caching/TSqliteCache.php @@ -4,7 +4,7 @@ *
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2011 PradoSoft + * @copyright Copyright © 2005-2011 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Caching
@@ -18,7 +18,7 @@ * To use this module, the sqlite PHP extension must be loaded. Note, Sqlite extension
* is no longer loaded by default since PHP 5.1.
*
- * Sine PRADO v3.1.0, a new DB-based cache module called {@link TDbCache}
+ * Since PRADO v3.1.0, a new DB-based cache module called {@link TDbCache}
* is provided. If you have PDO extension installed, you may consider using
* the new cache module instead as it allows you to use different database
* to store the cached data.
@@ -162,7 +162,7 @@ class TSqliteCache extends TCache {
$sql='SELECT value FROM '.self::CACHE_TABLE.' WHERE key=\''.$key.'\' AND (expire=0 OR expire>'.time().') LIMIT 1';
if(($ret=$this->_db->query($sql))!=false && ($row=$ret->fetch(SQLITE_ASSOC))!==false)
- return $row['value'];
+ return Prado::unserialize($row['value']);
else
return false;
}
@@ -179,7 +179,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.')';
+ $sql='REPLACE INTO '.self::CACHE_TABLE.' VALUES(\''.$key.'\',\''.sqlite_escape_string(Prado::serialize($value)).'\','.$expire.')';
return $this->_db->query($sql)!==false;
}
@@ -195,7 +195,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.')';
+ $sql='INSERT INTO '.self::CACHE_TABLE.' VALUES(\''.$key.'\',\''.sqlite_escape_string(Prado::serialize($value)).'\','.$expire.')';
return @$this->_db->query($sql)!==false;
}
|