内核更新

This commit is contained in:
2016-08-06 15:06:11 +08:00
parent 9f5c4070cc
commit fed3a1d215
11 changed files with 229 additions and 60 deletions

View File

@@ -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;
}
}
/**