Generic cache interface for FileSystem cache, Memcached, ApcCache, ... etc
Switch branches/tags
Nothing to show
Pull request Compare This branch is 17 commits behind c9s:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/CacheKit
tests
README.md
composer.json
package.ini
package.xml
phpunit.xml

README.md

CacheKit

CacheKit interface

$c = new CacheKit(array('Apc','MemoryCache'));

$c = new CacheKit;
$memory = $c->createBackend( $memcache );
$memory->set( 'foo' , '123' );
$memory->get('foo');

FileSystemCache

$serializer = new SerializerKit\Serializer('json');
$cache = new CacheKit\FileSystemCache(array( 
    'expiry' => 30,
    'cache_dir' => 'cache',
    'serializer' => $serializer,
));
$cache->clear();

$url = 'foo_bar';
$html = 'test content';
$cache->set( $url , $html );

$cache->remove( $url );

ok( null === $cache->get( $url ) );

$cache->clear();

ok( null === $cache->get( $url ) );