JSON file system cache library for PHP built on top of PSR-16.
PHP Cache library built by PSR-16 simple cache interface
You can find implementations of the specification by looking for packages providing the
psr/simple-cache-implementation virtual package.
This library is installed via Composer. To install,
- simply add to your
- run this command:
$ composer require sarahman/sarahman/json-filesystem-cache
- Create a file named
test.phpin your root directory and add these following codes:
<?php require "vendor/autoload.php"; $cache = new Sarahman\SimpleCache\JSONFileSystemCache(); // the custom cache directory can be set through the parameter. // Set Cache key. $data = [ 'sample' => 'data', 'another' => 'data' ]; $cache->set('your_custom_key', $data); // Check cached key exists or not. $cache->has('your_custom_key'); // Get Cached key data. $cache->get('your_custom_key');
- Then run
If you are having general issues with this package, feel free to contact me through Gmail.
If you believe you have found an issue, please report it using the GitHub issue tracker, or better yet, fork the repository and submit a pull request.
If you're using this package, I'd love to hear your thoughts. Thanks!