1、内核更新

2、后台bug修复(获取参数的bug)
This commit is contained in:
2016-07-04 00:14:28 +08:00
parent cf7f98f04c
commit 2da74dbc1e
31 changed files with 171 additions and 138 deletions

View File

@@ -23,6 +23,8 @@ class Memcached
'expire' => 0,
'timeout' => 0, // 超时时间(单位:毫秒)
'prefix' => '',
'username' => '', //账号
'password' => '', //密码
];
/**
@@ -55,6 +57,10 @@ class Memcached
$servers[] = [$host, (isset($ports[$i]) ? $ports[$i] : $ports[0]), 1];
}
$this->handler->addServers($servers);
if('' != $this->options['username']){
$this->handler->setOption(\Memcached::OPT_BINARY_PROTOCOL, true);
$this->handler->setSaslAuthData($this->options['username'], $this->options['password']);
}
}
/**
@@ -82,7 +88,7 @@ class Memcached
$expire = $this->options['expire'];
}
$name = $this->options['prefix'] . $name;
$expire = 0 == $expire ? 0 : time() + $expire;
$expire = 0 == $expire ? 0 : $_SERVER['REQUEST_TIME'] + $expire;
if ($this->handler->set($name, $value, $expire)) {
return true;
}