redis缓存驱动完善

This commit is contained in:
thinkphp
2016-07-26 16:14:54 +08:00
parent 7e8a5667e3
commit 23a0f50a7e

View File

@@ -106,6 +106,32 @@ class Redis
return $result;
}
/**
* 自增缓存(针对数值缓存)
* @access public
* @param string $name 缓存变量名
* @param int $step 步长
* @param int $expire 有效时间 0为永久
* @return false|int
*/
public function inc($name, $step = 1, $expire = null)
{
return $this->handler->incrby($name, $step);
}
/**
* 自减缓存(针对数值缓存)
* @access public
* @param string $name 缓存变量名
* @param int $step 步长
* @param int $expire 有效时间 0为永久
* @return false|int
*/
public function dec($name, $step = 1, $expire = null)
{
return $this->handler->decrby($name, $step);
}
/**
* 删除缓存
* @access public