diff options
author | Andrey Andreev <narf@devilix.net> | 2015-05-07 09:43:28 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-05-07 09:43:28 +0200 |
commit | 170ae282338584ebe257d2fb21101ccf84a3f800 (patch) | |
tree | 151037865fa21ee1ee54999c8666ae82436e97af /system/libraries | |
parent | 433c1a756f8c7ab9bc16e4721f98fee6faaee240 (diff) |
Issue/PR #3836
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Cache/drivers/Cache_redis.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php index b940b76cb..773d20c43 100644 --- a/system/libraries/Cache/drivers/Cache_redis.php +++ b/system/libraries/Cache/drivers/Cache_redis.php @@ -165,7 +165,9 @@ class CI_Cache_redis extends CI_Driver */ public function increment($id, $offset = 1) { - return $this->_redis->incr($id, $offset); + return ($offset == 1) + ? $this->_redis->incr($id) + : $this->_redis->incrBy($id, $offset); } // ------------------------------------------------------------------------ @@ -179,7 +181,9 @@ class CI_Cache_redis extends CI_Driver */ public function decrement($id, $offset = 1) { - return $this->_redis->decr($id, $offset); + return ($offset == 1) + ? $this->_redis->decr($id) + : $this->_redis->decrBy($id, $offset); } // ------------------------------------------------------------------------ |