Skip to content

JSON file system cache library for PHP built on top of PSR-16.

License

Notifications You must be signed in to change notification settings

sarahman/json-filesystem-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple JSON Cache Client Adapter

v1.0.0

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.

Installation

This library is installed via Composer. To install,

  • simply add to your composer.json file: "sarahman/json-filesystem-cache": "^1.0"

OR

  • run this command:
$ composer require sarahman/sarahman/json-filesystem-cache

Usages

  • Create a file named test.php in 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 php test.php.

Documentation

psr/simple-cache-implementation

Support

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!

About

JSON file system cache library for PHP built on top of PSR-16.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages