summaryrefslogtreecommitdiff
path: root/framework/Caching/TSqliteCache.php
diff options
context:
space:
mode:
authorctrlaltca@gmail.com <>2011-07-16 22:37:30 +0000
committerctrlaltca@gmail.com <>2011-07-16 22:37:30 +0000
commit920f78939adcdb62f5e6ac9368928bd3a0fa41fc (patch)
tree041a05cfb0efc62a19ff3d867546c13edc730bae /framework/Caching/TSqliteCache.php
parent086387ec68df8c39ed2580a55b32f909fd092f18 (diff)
test patch for #179
Diffstat (limited to 'framework/Caching/TSqliteCache.php')
-rw-r--r--framework/Caching/TSqliteCache.php10
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 &copy; 2005-2011 PradoSoft
+ * @copyright Copyright &copy; 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;
}