cache助手函数支持清空操作 cache(null) 或者 cache(null,'tagName');

This commit is contained in:
thinkphp
2016-10-27 14:39:26 +08:00
parent eed8bfb12d
commit 756992ef2e

View File

@@ -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)) {