From c9e0b9d43789dfbc90850866b2794dc8527a7153 Mon Sep 17 00:00:00 2001 From: edward1108 <443622740@qq.com> Date: Fri, 30 Oct 2020 12:44:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81ThinkPHP6.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 48 ++++++++++++++++++++++++++++++++---------------- src/config.php | 26 +++++++++++++++++--------- 2 files changed, 49 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 89bf4ff..fc51474 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,22 @@ ThinkPHP6.0.x 和 ThinkPHP5.1.x ``` config/redis.php return [ - 'host' => '127.0.0.1', // redis主机 - 'port' => '', // redis端口 - 'password' => '', // 密码 - 'select' => 0, // 操作库 - 'expire' => 0, // 有效期(秒) - 'timeout' => 0, // 超时时间(秒) - 'persistent' => true, // 是否长连接 - 'prefix' => '', //前缀 + // 缓存前缀 + 'prefix' => '', + // 缓存有效期 0表示永久缓存,单位:秒 + 'expire' => 0, + // redis主机 + 'host' => '127.0.0.1', + // redis端口 + 'port' => '', + // 密码 + 'password' => '', + // 操作库 + 'select' => 0, + // 超时时间(秒) + 'timeout' => 0, + // 是否长连接 + 'persistent' => false, ]; ``` @@ -25,14 +33,22 @@ ThinkPHP5.0.x ``` config.php 'redis' => [ - 'host' => '127.0.0.1', // redis主机 - 'port' => '', // redis端口 - 'password' => '', // 密码 - 'select' => 0, // 操作库 - 'expire' => 0, // 有效期(秒) - 'timeout' => 0, // 超时时间(秒) - 'persistent' => true, // 是否长连接 - 'prefix' => '', //前缀 + // 缓存前缀 + 'prefix' => '', + // 缓存有效期 0表示永久缓存,单位:秒 + 'expire' => 0, + // redis主机 + 'host' => '127.0.0.1', + // redis端口 + 'port' => '', + // 密码 + 'password' => '', + // 操作库 + 'select' => 0, + // 超时时间(秒) + 'timeout' => 0, + // 是否长连接 + 'persistent' => false, ] ``` diff --git a/src/config.php b/src/config.php index 2c3793b..f4a6054 100644 --- a/src/config.php +++ b/src/config.php @@ -1,15 +1,23 @@ '127.0.0.1', // redis主机 - 'port' => '', // redis端口 - 'password' => '', // 密码 - 'select' => 0, // 操作库 - 'expire' => 0, // 有效期(秒) - 'timeout' => 0, // 超时时间(秒) - 'persistent' => true, // 是否长连接 - 'prefix' => '', //前缀 + // 缓存前缀 + 'prefix' => '', + // 缓存有效期 0表示永久缓存,单位:秒 + 'expire' => 0, + // redis主机 + 'host' => '127.0.0.1', + // redis端口 + 'port' => '', + // 密码 + 'password' => '', + // 操作库 + 'select' => 0, + // 超时时间(秒) + 'timeout' => 0, + // 是否长连接 + 'persistent' => false, ];