diff options
author | Andrey Andreev <narf@devilix.net> | 2014-01-09 16:29:45 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-01-09 16:29:45 +0100 |
commit | 43d7fa73534c07d10a88ec120c0938d0d00a184e (patch) | |
tree | 84cc278c1d199da4e8d1dc4d7999cdbc174fc732 /system/libraries/Cache/drivers/Cache_dummy.php | |
parent | 40235e6890650690afeaa451738bf7f8e586cfc3 (diff) |
Implement atomic increment/decrement in Cache library
Requested via issue #109
Supersedes PR #241
Diffstat (limited to 'system/libraries/Cache/drivers/Cache_dummy.php')
-rw-r--r-- | system/libraries/Cache/drivers/Cache_dummy.php | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/system/libraries/Cache/drivers/Cache_dummy.php b/system/libraries/Cache/drivers/Cache_dummy.php index d9af3773b..7e2b907a6 100644 --- a/system/libraries/Cache/drivers/Cache_dummy.php +++ b/system/libraries/Cache/drivers/Cache_dummy.php @@ -58,9 +58,10 @@ class CI_Cache_dummy extends CI_Driver { * @param string Unique Key * @param mixed Data to store * @param int Length of time (in seconds) to cache the data + * @param bool Whether to store the raw value * @return bool TRUE, Simulating success */ - public function save($id, $data, $ttl = 60) + public function save($id, $data, $ttl = 60, $raw = FALSE) { return TRUE; } @@ -81,6 +82,34 @@ class CI_Cache_dummy extends CI_Driver { // ------------------------------------------------------------------------ /** + * Increment a raw value + * + * @param string $id Cache ID + * @param int $offset Step/value to add + * @return mixed New value on success or FALSE on failure + */ + public function increment($id, $offset = 1) + { + return TRUE; + } + + // ------------------------------------------------------------------------ + + /** + * Decrement a raw value + * + * @param string $id Cache ID + * @param int $offset Step/value to reduce by + * @return mixed New value on success or FALSE on failure + */ + public function decrement($id, $offset = 1) + { + return TRUE; + } + + // ------------------------------------------------------------------------ + + /** * Clean the cache * * @return bool TRUE, simulating success |