Skip to content
/ cache Public

Implementation PHP FIG Simple Cache PSR with Redis and Apcu Adapter

Notifications You must be signed in to change notification settings

viloveul/cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

make sure your php version > 7.0

composer require viloveul/cache

How

require __DIR__ . '/vendor/autoload.php';

$adapter = new Viloveul\Cache\ApcuAdapter();
// or
// $adapter = new Viloveul\Cache\RedisAdapter($host, $port);

$adapter->setDefaultLifeTime(3600);

$adapter->setPrefix('secret_maybe');

$cache = new Viloveul\Cache\Cache($adapter);

$cache->set('hello', 'world');

var_dump($cache->get('hello', 'default_value'));