diff --git a/library/think/Cache.php b/library/think/Cache.php index c7a48789..7ae31aae 100644 --- a/library/think/Cache.php +++ b/library/think/Cache.php @@ -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); } /** diff --git a/library/think/cache/driver/File.php b/library/think/cache/driver/File.php index 7f496e7d..97ee2bf6 100644 --- a/library/think/cache/driver/File.php +++ b/library/think/cache/driver/File.php @@ -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; } /** diff --git a/library/think/cache/driver/Lite.php b/library/think/cache/driver/Lite.php index e83f73e4..41c94d06 100644 --- a/library/think/cache/driver/Lite.php +++ b/library/think/cache/driver/Lite.php @@ -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; } /** diff --git a/library/think/cache/driver/Memcache.php b/library/think/cache/driver/Memcache.php index 44de09b4..62f98bce 100644 --- a/library/think/cache/driver/Memcache.php +++ b/library/think/cache/driver/Memcache.php @@ -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); } diff --git a/library/think/cache/driver/Memcached.php b/library/think/cache/driver/Memcached.php index a53533fb..2eec2ea2 100644 --- a/library/think/cache/driver/Memcached.php +++ b/library/think/cache/driver/Memcached.php @@ -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); } diff --git a/library/think/cache/driver/Redis.php b/library/think/cache/driver/Redis.php index c1749e27..99f9583d 100644 --- a/library/think/cache/driver/Redis.php +++ b/library/think/cache/driver/Redis.php @@ -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); } diff --git a/library/think/cache/driver/Sqlite.php b/library/think/cache/driver/Sqlite.php index 6814773a..a7cbfa01 100644 --- a/library/think/cache/driver/Sqlite.php +++ b/library/think/cache/driver/Sqlite.php @@ -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; } /** diff --git a/library/think/cache/driver/Wincache.php b/library/think/cache/driver/Wincache.php index 940ecc4e..e8e79b47 100644 --- a/library/think/cache/driver/Wincache.php +++ b/library/think/cache/driver/Wincache.php @@ -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); } /** diff --git a/library/think/cache/driver/Xcache.php b/library/think/cache/driver/Xcache.php index 99b01f6b..e58e5102 100644 --- a/library/think/cache/driver/Xcache.php +++ b/library/think/cache/driver/Xcache.php @@ -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); } /**