summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache/drivers/Cache_memcached.php
diff options
context:
space:
mode:
authorPascal Kriete <pascal@pascalkriete.com>2011-11-14 21:15:15 +0100
committerPascal Kriete <pascal@pascalkriete.com>2011-11-14 21:15:15 +0100
commitf525f10c850399700a4cce183aef55656ff44d31 (patch)
treed0250655551d773c9347573e594997e07d7280a5 /system/libraries/Cache/drivers/Cache_memcached.php
parent44cdece942c310f5520497dbde4febc26e96c27e (diff)
parent917c3455cc70d5117daa7359f345a820154ada3e (diff)
Merge branch 'release/2.1.0'
Conflicts: user_guide/helpers/url_helper.html
Diffstat (limited to 'system/libraries/Cache/drivers/Cache_memcached.php')
-rw-r--r--system/libraries/Cache/drivers/Cache_memcached.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/system/libraries/Cache/drivers/Cache_memcached.php b/system/libraries/Cache/drivers/Cache_memcached.php
index ec2fd216a..fc586e025 100644
--- a/system/libraries/Cache/drivers/Cache_memcached.php
+++ b/system/libraries/Cache/drivers/Cache_memcached.php
@@ -64,7 +64,16 @@ class CI_Cache_memcached extends CI_Driver {
*/
public function save($id, $data, $ttl = 60)
{
- return $this->_memcached->add($id, array($data, time(), $ttl), $ttl);
+ if (get_class($this->_memcached) == 'Memcached')
+ {
+ return $this->_memcached->set($id, array($data, time(), $ttl), $ttl);
+ }
+ else if (get_class($this->_memcached) == 'Memcache')
+ {
+ return $this->_memcached->set($id, array($data, time(), $ttl), 0, $ttl);
+ }
+
+ return FALSE;
}
// ------------------------------------------------------------------------