修复inc方法

This commit is contained in:
水平凡
2017-03-21 14:08:32 +08:00
committed by GitHub
parent b9c47a1332
commit 2971e93fd5

View File

@@ -125,8 +125,11 @@ class Memcached extends Driver
public function inc($name, $step = 1) public function inc($name, $step = 1)
{ {
$key = $this->getCacheKey($name); $key = $this->getCacheKey($name);
if( $this->has($name) ){
return $this->handler->increment($key, $step); return $this->handler->increment($key, $step);
} }
return $this->handler->set($key, $step);
}
/** /**
* 自减缓存(针对数值缓存) * 自减缓存(针对数值缓存)