From 756992ef2ee6faa740debb985069186c3c52bce0 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 27 Oct 2016 14:39:26 +0800 Subject: [PATCH] =?UTF-8?q?cache=E5=8A=A9=E6=89=8B=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=B8=85=E7=A9=BA=E6=93=8D=E4=BD=9C=20cache(?= =?UTF-8?q?null)=20=E6=88=96=E8=80=85=20cache(null,'tagName');?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helper.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helper.php b/helper.php index e0cc719e..ba9f46ad 100644 --- a/helper.php +++ b/helper.php @@ -359,7 +359,9 @@ if (!function_exists('cache')) { // 缓存初始化 return Cache::connect($name); } - if ('' === $value) { + if (is_null($name)) { + return Cache::clear($value); + } elseif ('' === $value) { // 获取缓存 return 0 === strpos($name, '?') ? Cache::has(substr($name, 1)) : Cache::get($name); } elseif (is_null($value)) {