mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
redis缓存驱动完善
This commit is contained in:
26
library/think/cache/driver/Redis.php
vendored
26
library/think/cache/driver/Redis.php
vendored
@@ -106,6 +106,32 @@ class Redis
|
|||||||
return $result;
|
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
|
* @access public
|
||||||
|
|||||||
Reference in New Issue
Block a user