mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进Redis驱动支持密码连接
This commit is contained in:
4
library/think/cache/driver/redis.php
vendored
4
library/think/cache/driver/redis.php
vendored
@@ -24,6 +24,7 @@ class Redis
|
||||
protected $options = [
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
'password' => '',
|
||||
'timeout' => false,
|
||||
'expire' => 0,
|
||||
'persistent' => false,
|
||||
@@ -48,6 +49,9 @@ class Redis
|
||||
false === $this->options['timeout'] ?
|
||||
$this->handler->$func($this->options['host'], $this->options['port']) :
|
||||
$this->handler->$func($this->options['host'], $this->options['port'], $this->options['timeout']);
|
||||
if ('' != $this->options['password']) {
|
||||
$this->handler->auth($this->options['password']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user