Package is available on Packagist, you can install it using Composer.
composer require ferrari/cache
$driver = new \Doctrine\Common\Cache\ArrayCache;
$cache = new \Ferrari\Cache($driver);
$cache->save('hello', 'world');
echo $cache->fetch('hello'); // 'world'
echo $cache['hello']; // 'world'
$cache->delete('hello'); // true
$cache->get('foo', function() {
return 'bar';
}); // 'bar'
echo $cache['foo']; // 'bar'
$cache['foo'] = 'walla!';
$cache->get('foo', function () {
'tchubiru'
}); // 'walla!'
unset($cache['foo']);
echo $cache->fetch('foo'); // false