Skip to content

caferrari/Cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

caferrari\Cache

Build Status Coverage Status Total Downloads License Latest Stable Version Latest Unstable Version

Installation

Package is available on Packagist, you can install it using Composer.

composer require ferrari/cache

Usage

$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

About

Simple caching library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages