提交 4a8a6ea5 编写于 作者: lzc828's avatar lzc828

RedisCluster

上级 aa56fa30
......@@ -70,12 +70,16 @@ class Redis extends Cache
*/
private function createRes()
{
$r = new \Redis();
$r->connect($this->config['host'], $this->config['port'], 0);
if (!empty($this->config['auth'])) {
$r->auth($this->config['auth']);
if (isset($this->config['is_cluster']) && $this->config['is_cluster'] === true) {
return new \RedisCluster(...$this->config['args']);
} else {
$r = new \Redis();
$r->connect($this->config['host'], $this->config['port'], 0);
if (!empty($this->config['auth'])) {
$r->auth($this->config['auth']);
}
return $r;
}
return $r;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册