mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 15:42:48 +08:00
cache助手函数支持 remember方法 ,用法为:
cache('?name',function(){
return 'value';
});
或者
cache('?name','value);
This commit is contained in:
@@ -365,6 +365,9 @@ if (!function_exists('cache')) {
|
|||||||
} elseif (is_null($value)) {
|
} elseif (is_null($value)) {
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
return Cache::rm($name);
|
return Cache::rm($name);
|
||||||
|
} elseif (0 === strpos($name, '?') && '' !== $value) {
|
||||||
|
$expire = is_numeric($options) ? $options : null;
|
||||||
|
return Cache::remember(substr($name, 1), $value, $expire);
|
||||||
} else {
|
} else {
|
||||||
// 缓存数据
|
// 缓存数据
|
||||||
if (is_array($options)) {
|
if (is_array($options)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user