nyuwa / simplecache
基于文件的PHP简单缓存。
dev-master
2023-03-16 03:21 UTC
Requires
- php: ^7.0 || ^8.0
This package is not auto-updated.
Last update: 2024-09-27 08:54:40 UTC
README
安装说明
//install by composer
composer require jiaweixs/simplecache
//or clone from github
git clone git@github.com:kulokai/simplecache.git
使用方法
//init the tool SimpleCache::init('.../path/to/cache'); //init the tool and set default expire time. SimpleCache::init('.../path/to/cache',600);
//set cache $isSuccess = SimpleCache::set('key','hello world'); //set cache and set expire time for the 'key'. $isSuccess = SimpleCache::set('key','hello world',600);
//get cache $value = SimpleCache::get('key'); //get cache and set default value for the 'key'. $value = SimpleCache::get('key','default value');