mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
去掉cache类inc和dec方法的expire参数
This commit is contained in:
@@ -115,14 +115,13 @@ class Cache
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public static function inc($name, $step = 1, $expire = null)
|
||||
public static function inc($name, $step = 1)
|
||||
{
|
||||
self::init();
|
||||
self::$writeTimes++;
|
||||
return self::$handler->inc($name, $step, $expire);
|
||||
return self::$handler->inc($name, $step);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -130,14 +129,13 @@ class Cache
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public static function dec($name, $step = 1, $expire = null)
|
||||
public static function dec($name, $step = 1)
|
||||
{
|
||||
self::init();
|
||||
self::$writeTimes++;
|
||||
return self::$handler->dec($name, $step, $expire);
|
||||
return self::$handler->dec($name, $step);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
10
library/think/cache/driver/File.php
vendored
10
library/think/cache/driver/File.php
vendored
@@ -161,17 +161,16 @@ class File
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function inc($name, $step = 1, $expire = null)
|
||||
public function inc($name, $step = 1)
|
||||
{
|
||||
if ($this->has($name)) {
|
||||
$value = $this->get($name) + $step;
|
||||
} else {
|
||||
$value = $step;
|
||||
}
|
||||
return $this->set($name, $value, $expire) ? $value : false;
|
||||
return $this->set($name, $value, 0) ? $value : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -179,17 +178,16 @@ class File
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function dec($name, $step = 1, $expire = null)
|
||||
public function dec($name, $step = 1)
|
||||
{
|
||||
if ($this->has($name)) {
|
||||
$value = $this->get($name) - $step;
|
||||
} else {
|
||||
$value = $step;
|
||||
}
|
||||
return $this->set($name, $value, $expire) ? $value : false;
|
||||
return $this->set($name, $value, 0) ? $value : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
10
library/think/cache/driver/Lite.php
vendored
10
library/think/cache/driver/Lite.php
vendored
@@ -118,17 +118,16 @@ class Lite
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function inc($name, $step = 1, $expire = null)
|
||||
public function inc($name, $step = 1)
|
||||
{
|
||||
if ($this->has($name)) {
|
||||
$value = $this->get($name) + $step;
|
||||
} else {
|
||||
$value = $step;
|
||||
}
|
||||
return $this->set($name, $value, $expire) ? $value : false;
|
||||
return $this->set($name, $value, 0) ? $value : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,17 +135,16 @@ class Lite
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function dec($name, $step = 1, $expire = null)
|
||||
public function dec($name, $step = 1)
|
||||
{
|
||||
if ($this->has($name)) {
|
||||
$value = $this->get($name) - $step;
|
||||
} else {
|
||||
$value = $step;
|
||||
}
|
||||
return $this->set($name, $value, $expire) ? $value : false;
|
||||
return $this->set($name, $value, 0) ? $value : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
6
library/think/cache/driver/Memcache.php
vendored
6
library/think/cache/driver/Memcache.php
vendored
@@ -105,10 +105,9 @@ class Memcache
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function inc($name, $step = 1, $expire = null)
|
||||
public function inc($name, $step = 1)
|
||||
{
|
||||
return $this->handler->increment($name, $step);
|
||||
}
|
||||
@@ -118,10 +117,9 @@ class Memcache
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function dec($name, $step = 1, $expire = null)
|
||||
public function dec($name, $step = 1)
|
||||
{
|
||||
return $this->handler->decrement($name, $step);
|
||||
}
|
||||
|
||||
6
library/think/cache/driver/Memcached.php
vendored
6
library/think/cache/driver/Memcached.php
vendored
@@ -111,10 +111,9 @@ class Memcached
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function inc($name, $step = 1, $expire = null)
|
||||
public function inc($name, $step = 1)
|
||||
{
|
||||
return $this->handler->increment($name, $step);
|
||||
}
|
||||
@@ -124,10 +123,9 @@ class Memcached
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function dec($name, $step = 1, $expire = null)
|
||||
public function dec($name, $step = 1)
|
||||
{
|
||||
return $this->handler->decrement($name, $step);
|
||||
}
|
||||
|
||||
6
library/think/cache/driver/Redis.php
vendored
6
library/think/cache/driver/Redis.php
vendored
@@ -111,10 +111,9 @@ class Redis
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function inc($name, $step = 1, $expire = null)
|
||||
public function inc($name, $step = 1)
|
||||
{
|
||||
return $this->handler->incrby($name, $step);
|
||||
}
|
||||
@@ -124,10 +123,9 @@ class Redis
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function dec($name, $step = 1, $expire = null)
|
||||
public function dec($name, $step = 1)
|
||||
{
|
||||
return $this->handler->decrby($name, $step);
|
||||
}
|
||||
|
||||
10
library/think/cache/driver/Sqlite.php
vendored
10
library/think/cache/driver/Sqlite.php
vendored
@@ -115,17 +115,16 @@ class Sqlite
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function inc($name, $step = 1, $expire = null)
|
||||
public function inc($name, $step = 1)
|
||||
{
|
||||
if ($this->has($name)) {
|
||||
$value = $this->get($name) + $step;
|
||||
} else {
|
||||
$value = $step;
|
||||
}
|
||||
return $this->set($name, $value, $expire) ? $value : false;
|
||||
return $this->set($name, $value, 0) ? $value : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,17 +132,16 @@ class Sqlite
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function dec($name, $step = 1, $expire = null)
|
||||
public function dec($name, $step = 1)
|
||||
{
|
||||
if ($this->has($name)) {
|
||||
$value = $this->get($name) - $step;
|
||||
} else {
|
||||
$value = $step;
|
||||
}
|
||||
return $this->set($name, $value, $expire) ? $value : false;
|
||||
return $this->set($name, $value, 0) ? $value : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
10
library/think/cache/driver/Wincache.php
vendored
10
library/think/cache/driver/Wincache.php
vendored
@@ -90,12 +90,11 @@ class Wincache
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function inc($name, $step = 1, $expire = null)
|
||||
public function inc($name, $step = 1)
|
||||
{
|
||||
return wincache_ucache_inc($name, $step, $expire);
|
||||
return wincache_ucache_inc($name, $step);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,12 +102,11 @@ class Wincache
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function dec($name, $step = 1, $expire = null)
|
||||
public function dec($name, $step = 1)
|
||||
{
|
||||
return wincache_ucache_dec($name, $step, $expire);
|
||||
return wincache_ucache_dec($name, $step);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
10
library/think/cache/driver/Xcache.php
vendored
10
library/think/cache/driver/Xcache.php
vendored
@@ -90,12 +90,11 @@ class Xcache
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function inc($name, $step = 1, $expire = null)
|
||||
public function inc($name, $step = 1)
|
||||
{
|
||||
return xcache_inc($name, $step, $expire);
|
||||
return xcache_inc($name, $step);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,12 +102,11 @@ class Xcache
|
||||
* @access public
|
||||
* @param string $name 缓存变量名
|
||||
* @param int $step 步长
|
||||
* @param int $expire 有效时间 0为永久
|
||||
* @return false|int
|
||||
*/
|
||||
public function dec($name, $step = 1, $expire = null)
|
||||
public function dec($name, $step = 1)
|
||||
{
|
||||
return xcache_dec($name, $step, $expire);
|
||||
return xcache_dec($name, $step);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user