【文件属性】:
文件名称:php-redis-cache:PHP Redis Cache缓存策略技术
文件大小:4KB
文件格式:ZIP
更新时间:2021-05-16 11:15:13
PHP
1 使用方法
使用composer下载 yeszao/cache 组件:
composer install yeszao/cache
在MVC框架Model层或者Service层的基类添加__call()方法,例如:
namespace app\models;
use yeszao\cache;
class Base
{
public function __call($name, $arguments)
{
$redis = new \Redis();
$redis->connect('redis');
// ***主要是这一行***
return (new Cache($redis))->get($this, $name, $arguments);
}
}
其中,yeszao\cache\Cache对
【文件预览】:
php-redis-cache-master
----Cache.php(4KB)
----LICENSE(1KB)
----composer.json(487B)
----README.md(3KB)