Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Generic cache interface for FileSystem cache, Memcached, ApcCache, ... etc
PHP
tree: 4b96238216

Fetching latest commit…

Cannot retrieve the latest commit at this time

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 ) );
Something went wrong with that request. Please try again.