theriskus / cache
dev-master
2019-10-02 09:25 UTC
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2024-09-04 21:55:38 UTC
README
需求
- PHP 5.6 > above
- Composer
- Redis 5.0 (可选)
- Memcached 1.5.X (可选)
安装
要安装此模块,您应该使用composer库:composer require theriskus/cache
简单使用
- 为了初始化,在您的引导文件中添加以下内容:
Cache::init(driver);
并添加use WorkTestMax\Classes\Cache
驱动必须是字符串,且等于:'redis'或'memcached'或'file'
- 为了设置任何参数:
Cache::set(string $cache_id, mixed $data, int $ttl, string $sub_dir = '')
- 为了获取任何参数:
Cache::get(string $cache_id, string $sub_dir = '');