cjmarkham / disk-cache
A Disk Caching service for Silex
dev-master
2014-02-03 14:27 UTC
Requires
- silex/silex: ~1.0
This package is not auto-updated.
Last update: 2024-12-31 05:04:40 UTC
README
A disk cache service for silex
Registering
In composer.json add this to your dependencies
"cjmarkham/disk-cache": "dev-master"
Then to register
$app->register(new DiskCache\DiskCacheServiceProvider());
Options
cache_dir
- The path to the output directory
Usage
$app->register(new DiskCache\DiskCacheServiceProvider(), array(
'diskcache.cache_dir' => dirname(dirname(__FILE__)) . '/cache'
));
$app['diskcache']->set('foo', 'bar');
$app['diskcache']->get('foo');
$app['diskcache']->delete('foo');
Groups
Groups can be defined using a period (.).
$app['diskcache']->set('groupname.foo');
$app['diskcache']->delete_group('groupname');