内核更新
This commit is contained in:
10
core/library/think/cache/driver/Memcached.php
vendored
10
core/library/think/cache/driver/Memcached.php
vendored
@@ -115,6 +115,7 @@ class Memcached
|
||||
*/
|
||||
public function inc($name, $step = 1)
|
||||
{
|
||||
$name = $this->options['prefix'] . $name;
|
||||
return $this->handler->increment($name, $step);
|
||||
}
|
||||
|
||||
@@ -127,7 +128,14 @@ class Memcached
|
||||
*/
|
||||
public function dec($name, $step = 1)
|
||||
{
|
||||
return $this->handler->decrement($name, $step);
|
||||
$name = $this->options['prefix'] . $name;
|
||||
$value = $this->handler->get($name) - $step;
|
||||
$res = $this->handler->set($name, $value);
|
||||
if (!$res) {
|
||||
return false;
|
||||
} else {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user