简单的缓存系统

3.0.2 2023-01-17 10:09 UTC

This package is auto-updated.

Last update: 2024-09-17 13:59:57 UTC


README

定义常量 WT_CACHE_PATH 以设置缓存文件夹。如果没有 WT_CACHE_PATH,则保存到供应商目录

安装

composer require traineratwot/cache

示例

$key = ['key'];
$value = ['value'];

\Traineratwot\Cache\Cache::setCache($key,$value,600,'category/subcategory')

\Traineratwot\Cache\Cache::getCache($key,$value,600,'category/subcategory')

\Traineratwot\Cache\Cache::call($key,function($v) use ($key){
if(count($key) === 1){
	return $v
	}
	return 'noValue'
},600,'category/subcategory',$value)

\Traineratwot\Cache\Cache::autoRemove()

\Traineratwot\Cache\Cache::removeAll()