From 920f78939adcdb62f5e6ac9368928bd3a0fa41fc Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Sat, 16 Jul 2011 22:37:30 +0000 Subject: test patch for #179 --- framework/Caching/TCache.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'framework/Caching/TCache.php') diff --git a/framework/Caching/TCache.php b/framework/Caching/TCache.php index 39f3e780..57bdb4db 100644 --- a/framework/Caching/TCache.php +++ b/framework/Caching/TCache.php @@ -122,9 +122,8 @@ abstract class TCache extends TModule implements ICache, ArrayAccess */ public function get($id) { - if(($value=$this->getValue($this->generateUniqueKey($id)))!==false) + if(($data=$this->getValue($this->generateUniqueKey($id)))!==false) { - $data=unserialize($value); if(!is_array($data)) return false; if(!($data[1] instanceof ICacheDependency) || !$data[1]->getHasChanged()) @@ -152,7 +151,7 @@ abstract class TCache extends TModule implements ICache, ArrayAccess else { $data=array($value,$dependency); - return $this->setValue($this->generateUniqueKey($id),serialize($data),$expire); + return $this->setValue($this->generateUniqueKey($id),$data,$expire); } } @@ -170,7 +169,7 @@ abstract class TCache extends TModule implements ICache, ArrayAccess if(empty($value) && $expire === 0) return false; $data=array($value,$dependency); - return $this->addValue($this->generateUniqueKey($id),serialize($data),$expire); + return $this->addValue($this->generateUniqueKey($id),$data,$expire); } /** @@ -252,7 +251,7 @@ abstract class TCache extends TModule implements ICache, ArrayAccess return $this->get($id) !== false; } - /* + /** * Retrieves the value from cache with a specified key. * This method is required by the interface ArrayAccess. * @param string a key identifying the cached value @@ -263,7 +262,7 @@ abstract class TCache extends TModule implements ICache, ArrayAccess return $this->get($id); } - /* + /** * Stores the value identified by a key into cache. * If the cache already contains such a key, the existing value will be * replaced with the new ones. To add expiration and dependencies, use the set() method. @@ -276,7 +275,7 @@ abstract class TCache extends TModule implements ICache, ArrayAccess $this->set($id, $value); } - /* + /** * Deletes the value with the specified key from cache * This method is required by the interface ArrayAccess. * @param string the key of the value to be deleted -- cgit v1.2.3