summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache/drivers
diff options
context:
space:
mode:
authorMark Huot <mark@markhuot.com>2011-09-23 14:20:29 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-10-27 00:36:56 +0200
commitb7263d152a3c29751e39fd74972707f62f51ca72 (patch)
tree38071fcb363a12d4f6152a52d35ef3c106e520d4 /system/libraries/Cache/drivers
parentc5efd10679a7b7b4010cd6cc30bd976d3fe8c1ef (diff)
resolve a difference between the two memcache set method parameters
Diffstat (limited to 'system/libraries/Cache/drivers')
-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;
}
// ------------------------------------------------------------------------