sanzodown / simple-php-cache
A simple cache library in php.
dev-master
2019-04-26 20:37 UTC
Requires (Dev)
- phpunit/phpunit: ^8.1
- symfony/var-dumper: ^4.2
This package is not auto-updated.
Last update: 2025-06-30 11:50:40 UTC
README
A simple cache library for php. It implement both a file and a memory (APCu) cache back-ends.
Installation
As simple as :
composer require sanzodown/simple-php-cache
Usage
Both come with default configuration so if you don't bother, use it.
File cache:
$cache = new FileCache(
'your/cache/path',
'youNameFile'
);
Memory cache:
Note that you must have the extension APCu enabled.
$cache = new ApcCache(
3600, // Time to live
);
Methods:
$cache->set('key', 'Your datas');
$cache->get('test'); // Your datas