traineratwot / cache
simple cache system
Installs: 2 331
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: ^8.1
- psr/simple-cache: ^3.0
- traineratwot/config: ^1.0
Requires (Dev)
- jetbrains/phpstorm-attributes: dev-master
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-latest
- traineratwot/composer-config: ^1.1
README
define const WT_CACHE_PATH
for set cache folder. without WT_CACHE_PATH
save to vendor directory
install
composer require traineratwot/cache
Example:
$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()