PHPackages                             infobiotech/php-json-cache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. infobiotech/php-json-cache

ActiveLibrary[Caching](/categories/caching)

infobiotech/php-json-cache
==========================

JSON-based PSR-16 cache implementation.

v0.3.0(8y ago)336MITPHPPHP &gt;=5.6CI failing

Since Nov 5Pushed 8y ago2 watchersCompare

[ Source](https://github.com/infobiotech/php-json-cache)[ Packagist](https://packagist.org/packages/infobiotech/php-json-cache)[ Docs](https://github.com/infobiotech/php-json-cache)[ RSS](/packages/infobiotech-php-json-cache/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (7)Dependencies (4)Versions (9)Used By (0)

[!["infobiotech logo"](assets/logo-infobiotech-black-noclaim.png)](http://infobiotech.net?ibtref=github-readme-header)

infobiotech/php-json-cache
==========================

[](#infobiotechphp-json-cache)

[![Minimum PHP Version](https://camo.githubusercontent.com/86e7d829a466cacd5658a22073e27d49d39dac72cc18216ac4963ed5463c5bbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e362d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/dc148f36bd675a1b1234e9911fa54badeb7313d2761b73d908103efbe8821602/68747470733a2f2f706f7365722e707567782e6f72672f696e666f62696f746563682f7068702d6a736f6e2d63616368652f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/infobiotech/php-json-cache)[![Latest Unstable Version](https://camo.githubusercontent.com/b511dbcca3ad74a91b696008aaac537cd8feb9e34c79434c52f9f086efabe1c1/68747470733a2f2f706f7365722e707567782e6f72672f696e666f62696f746563682f7068702d6a736f6e2d63616368652f762f756e737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/infobiotech/php-json-cache)[![Total Downloads](https://camo.githubusercontent.com/6855f21c88b70bd09a1063136510fd2a1fb6703d43ebf0db51df230972423d87/68747470733a2f2f706f7365722e707567782e6f72672f696e666f62696f746563682f7068702d6a736f6e2d63616368652f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/infobiotech/php-json-cache)[![composer.lock](https://camo.githubusercontent.com/ebad306039ae6f47357bcfc252bc74467ca9f3dd57c85cf33894005ca9804816/68747470733a2f2f706f7365722e707567782e6f72672f696e666f62696f746563682f7068702d6a736f6e2d63616368652f636f6d706f7365726c6f636b3f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/infobiotech/php-json-cache)[![License](https://camo.githubusercontent.com/887888951c0b02f54277f46fd3b0ece6a9ce7dcd9e4354292fcad54f94c9d2f2/68747470733a2f2f706f7365722e707567782e6f72672f696e666f62696f746563682f7068702d6a736f6e2d63616368652f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/infobiotech/php-json-cache)

A key-value JSON-based PSR-16 cache implementation.

Built with:

- [PHP-FIG PSR-16](http://www.php-fig.org/psr/psr-16/): a common interface for caching libraries.
- [Psr\\SimpleCache](https://github.com/php-fig/simple-cache): a repository that holds all interfaces related to PSR-16.
- [League\\Flysystem](https://flysystem.thephpleague.com/): a filesystem abstraction that allows to easily swap out a local filesystem for a remote one.

---

Here our Quality Assurance indicators for `master` git branch.

build statuscode coveragecode qualityTravis CI[![Build Status](https://camo.githubusercontent.com/8e759f5adad414eb68f3ebe18d28c57d5b63c97b5ccc0cbc6cf00a894f7f9e49/68747470733a2f2f7472617669732d63692e6f72672f696e666f62696f746563682f7068702d6a736f6e2d63616368652e7376673f6272616e63683d6d617374657226666f726d61743d666c61742d737175617265)](https://travis-ci.org/infobiotech/php-json-cache)CodeCov[![codecov](https://camo.githubusercontent.com/ce3d242abd636f33d2ecb368bff2ca2ae64178de080b43b63a7257e47dd89e2f/68747470733a2f2f636f6465636f762e696f2f67682f696e666f62696f746563682f7068702d6a736f6e2d63616368652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/infobiotech/php-json-cache)Scrutinizer[![Build Status](https://camo.githubusercontent.com/061f5853196a8f5da20dc8e01fd654a2faaca117e93288664c7fde7cd2a89380/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f696e666f62696f746563682f7068702d6a736f6e2d63616368652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/infobiotech/php-json-cache/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e5e29ddf8e40239a72299b594a7caed64a0370e188dd8b88809c8292752d8552/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f696e666f62696f746563682f7068702d6a736f6e2d63616368652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/infobiotech/php-json-cache/?branch=master)Code Climate[![Maintainability](https://camo.githubusercontent.com/f4d17fec1b386156f1f34b745cb27808eb8dbf9cf0209071c5bcf3eb97076207/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31356537623061613961333566653064666666652f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/infobiotech/php-json-cache/maintainability)Codacy[![Codacy Badge](https://camo.githubusercontent.com/12e37dbe56042ef64650c823f7729547f0a0a502c0b62845b943bf38f0a0ff27/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3434366463643135646531363437616161306166346530626130643966303231)](https://www.codacy.com/app/alessandroraffa/php-json-cache?utm_source=github.com&utm_medium=referral&utm_content=infobiotech/php-json-cache&utm_campaign=Badge_Coverage)[![Codacy Badge](https://camo.githubusercontent.com/efec6f5acceac9dc0f676c12408d80d36a50bd5ff2ea209136733398f5b43d42/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3434366463643135646531363437616161306166346530626130643966303231)](https://www.codacy.com/app/alessandroraffa/php-json-cache?utm_source=github.com&utm_medium=referral&utm_content=infobiotech/php-json-cache&utm_campaign=Badge_Grade)---

Why JSON?
---------

[](#why-json)

- In some situations, remote web hosts do not support (or do not allow to install) major cache drivers.
- JSON objects allow to set/get key-value items.

Getting Started
---------------

[](#getting-started)

### Prerequisites

[](#prerequisites)

- PHP 5.6 or greater (including 7.0, 7.1 and [HHVM](https://hhvm.com/))

### Installing via composer

[](#installing-via-composer)

Make sure you have [composer](http://getcomposer.org/) installed.

Then run the following command from your project root:

```
$ composer require infobiotech/php-json-cache
```

Usage
-----

[](#usage)

**infobiotech/php-json-cache** implements [PSR-16](http://www.php-fig.org/psr/psr-16/) and thus provides a standardized API for storing and retrieving data.

Here is a simple use case:

```
