We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
自定义缓存 use Overtrue\Wechat\Cache;
// 写入 Cache::setter(function($key, $value, $lifetime){ return your_custom_set_cache($key, $value, $lifetime); });
// 读取 Cache::getter(function($key){ return your_custom_get_cache($key); }); 请教下,自定义的方法有什么作用? 可以直接这样写吗? Cache::setter(function(‘abc’, $value, 3600){ return true; }); 谢谢~~~~
The text was updated successfully, but these errors were encountered:
自定义的方法有什么作用?
就是自定义缓存写入与读取的方式。
Cache::setter(function(‘abc’, $value, 3600){ return true; });
你的意思是你不想缓存?
Sorry, something went wrong.
谢谢,我是这样缓存的 use Overtrue\Wechat\Cache; $prefix = ‘wx’; $Cache = new Cache($prefix); $Cache->set('access_token', $access_token); $Cache->set('refresh_token', $refresh_token); $access_token = $Cache->get('access_token'); $refresh_token = $Cache->get('refresh_token'); 缓存数据正常,读取也正常 另外请教下setter和getter以及里面的自定义函数有什么用处,要自定义函数,能实现什么更强大的功能? Cache::setter(function($key, $value, $lifetime){ return your_custom_set_cache($key, $value, $lifetime); }); Cache::getter(function($key){ return your_custom_get_cache($key); });
your_custom_set_cache 是不存在的,只是 举例的一个名称,意思是这里你用自己的方式去 写 和 读 缓存
your_custom_set_cache
No branches or pull requests
自定义缓存
use Overtrue\Wechat\Cache;
// 写入
Cache::setter(function($key, $value, $lifetime){
return your_custom_set_cache($key, $value, $lifetime);
});
// 读取
Cache::getter(function($key){
return your_custom_get_cache($key);
});
请教下,自定义的方法有什么作用?
可以直接这样写吗?
Cache::setter(function(‘abc’, $value, 3600){
return true;
});
谢谢~~~~
The text was updated successfully, but these errors were encountered: