g4 / russian-doll
russian-doll php library
Installs: 55 570
Dependents: 1
Suggesters: 0
Security: 0
Stars: 11
Watchers: 12
Forks: 1
Open Issues: 0
Requires
- php: >=5.4
- g4/mcache: *
Requires (Dev)
- phpunit/phpunit: 3.7.*
README
russian-doll - caching schema php library - inspired by rails/cache_digests
Install
Install through composer package manager. Find it on packagist.
composer require g4/russian-doll
Dependency:
- g4/mcache package.
Usage
Check mcache docs for details - mcache
<?php $mcache = \G4\Mcache\McacheFactory::createInstance($driverName, $options, $prefix); $key = \G4\RussianDoll\Key('posts'); $key ->addVariablePart($perPage) ->addVariablePart($page); $russianDoll = new \G4\RussianDoll\RussianDoll($mcache); $russianDoll->setKey($key); // get data from cache $posts = $russianDoll->fetch(); // write data to cache $russianDoll->write($posts); // invalidate cache entry $russianDoll->expire();
Development
Install dependencies
$ make install
Run tests
$ make test
License
(The MIT License) see LICENSE file for details...