From f4c498d3c34768392ed1d5d0f770f3e062579dd7 Mon Sep 17 00:00:00 2001 From: wuyumin Date: Fri, 1 Jan 2016 14:48:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRedis=E9=A9=B1=E5=8A=A8?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=AF=86=E7=A0=81=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/cache/driver/redis.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/think/cache/driver/redis.php b/library/think/cache/driver/redis.php index cbf9c072..ebb46108 100644 --- a/library/think/cache/driver/redis.php +++ b/library/think/cache/driver/redis.php @@ -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']); + } } /**