function get($keyword, $option = array()) {
if($this->is_driver == true) {
$object = $this->driver_get($keyword,$option);
} else {
$object = $this->driver->driver_get($keyword,$option);
}
if($object == null) {
return null;
}
return $object['value'];
}
function increment($keyword, $step = 1 , $option = array()) {
$object = $this->get($keyword);
if($object == null) {
return false;
} else {
$value = (Int)$object['value'] + (Int)$step;
$time = $object['expired_time'] - @date("U");
$this->set($keyword,$value, $time, $option);
return true;
}
}
function decrement($keyword, $step = 1 , $option = array()) {
$object = $this->get($keyword);
if($object == null) {
return false;
} else {
$value = (Int)$object['value'] - (Int)$step;
$time = $object['expired_time'] - @date("U");
$this->set($keyword,$value, $time, $option);
return true;
}
}
function touch($keyword, $time = 300, $option = array()) {
$object = $this->get($keyword);
if($object == null) {
return false;
} else {
$value = $object['value'];
$time = $object['expired_time'] - @date("U") + $time;
$this->set($keyword, $value,$time, $option);
return true;
}
}
will not work and will also mess up the cached values.
I'm fixing it by passing an option to the get method so it returns the entire array.
Will send a Pull request for both this issue and the Redis driver once resolved and tested.