viloveul/cache

Viloveul cache. Implementation psr/simple-cache with apcu and redisclient

Installs: 164

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:component

v1.0.6 2019-06-06 19:24 UTC

This package is auto-updated.

Last update: 2024-04-07 06:54:10 UTC


README

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'));