cache助手函数支持判断缓存是否有效

This commit is contained in:
thinkphp
2016-09-18 12:43:10 +08:00
parent 91cfa8ba4c
commit 09598e67b3

View File

@@ -361,7 +361,7 @@ if (!function_exists('cache')) {
}
if ('' === $value) {
// 获取缓存
return Cache::get($name);
return 0 === strpos($name, '?') ? Cache::has(substr($name, 1)) : Cache::get($name);
} elseif (is_null($value)) {
// 删除缓存
return Cache::rm($name);