From 1fc8b9aacf7dc71d2378ee7a9e36c2459fbbb595 Mon Sep 17 00:00:00 2001 From: tangxuliang <1297441127@qq.com> Date: Thu, 24 Mar 2022 17:03:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=85=8D=E7=BD=AE=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Redis.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index fd8bce3..80ae5c1 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -21,14 +21,14 @@ public function __construct(array $config = []) $options = [ 'parameters' => [ - 'password' => $config['password'] ?? getenv('REDIS_PASSWORD') ?? '', - 'database' => $config['database'] ?? getenv('REDIS_DB') ?? 0, + 'password' => $config['password'] ?? getenv('REDIS_PASSWORD') ?: '', + 'database' => $config['database'] ?? getenv('REDIS_DB') ?: 0, ], ]; $this->client = new Client([ 'scheme' => 'tcp', - 'host' => $config['host'] ?? getenv('REDIS_HOST') ?? '127.0.0.1', - 'port' => $config['port'] ?? getenv('REDIS_PORT') ?? 6379, + 'host' => $config['host'] ?? getenv('REDIS_HOST') ?: '127.0.0.1', + 'port' => $config['port'] ?? getenv('REDIS_PORT') ?: 6379, ], $options); }