From b5d7338bcead063e2365b429900ec233f90b3a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=98=E7=BC=98?= Date: Sun, 8 May 2016 08:50:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20redis=20set=EF=BC=8Credis?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=AE=BE=E7=BD=AE=E4=B8=80=E4=B8=AA=20expire?= =?UTF-8?q?=20=E4=B8=BA=200=20=E7=9A=84key?= 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, 2 insertions(+), 2 deletions(-) diff --git a/library/think/cache/driver/Redis.php b/library/think/cache/driver/Redis.php index 176949e8..23455a1d 100644 --- a/library/think/cache/driver/Redis.php +++ b/library/think/cache/driver/Redis.php @@ -29,7 +29,7 @@ class Redis 'port' => 6379, 'password' => '', 'timeout' => 0, - 'expire' => false, + 'expire' => 0, 'persistent' => false, 'length' => 0, 'prefix' => '', @@ -87,7 +87,7 @@ class Redis $name = $this->options['prefix'] . $name; //对数组/对象数据进行缓存处理,保证数据完整性 byron sampson $value = (is_object($value) || is_array($value)) ? json_encode($value) : $value; - if (is_int($expire)) { + if (is_int($expire) && $expire) { $result = $this->handler->setex($name, $expire, $value); } else { $result = $this->handler->set($name, $value);