villain / cache
Cache Component for PHP
v1.0.3
2021-12-05 14:32 UTC
Requires
- php: >=7.4
- ext-fileinfo: *
- psr/simple-cache: ^1.0.0
Requires (Dev)
- phpunit/phpunit: ^7.5
README
PHP Cache Component
Install
- composer command
composer require villain/cache
Example
MultiFile
$config = [ 'adapter' => 'MultiFileAdapter' ]; $cache = new Cache($config); $cache->set('key', 'value');
File
$config = [ 'dataFile' => __DIR__ . '/catch.txt' ]; $cache = new Cache($config); $cache->set('key', 'value'); var_dump($cache->get('key'));
Array
$config = []; $cache = new Cache($config); $cache->set('key', 'value'); var_dump($cache->get('key'));