From 22989a5316125e79b63912abf4a1bedc9b6f5c4c Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 9 Mar 2016 17:22:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3memcached=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E9=A9=B1=E5=8A=A8=E7=9A=84=E6=9C=89=E6=95=88=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/cache/driver/Memcached.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/think/cache/driver/Memcached.php b/library/think/cache/driver/Memcached.php index 5072ca57..7521e758 100644 --- a/library/think/cache/driver/Memcached.php +++ b/library/think/cache/driver/Memcached.php @@ -84,7 +84,8 @@ class Memcached if (is_null($expire)) { $expire = $this->options['expire']; } - $name = $this->options['prefix'] . $name; + $name = $this->options['prefix'] . $name; + $expire = 0 == $expire ? 0 : time() + $expire; if ($this->handler->set($name, $value, $expire)) { if ($this->options['length'] > 0) { // 记录缓存队列