{"id":21688443,"url":"https://github.com/infobiotech/php-json-cache","last_synced_at":"2026-05-07T20:09:06.685Z","repository":{"id":56991172,"uuid":"109566219","full_name":"infobiotech/php-json-cache","owner":"infobiotech","description":"A JSON-based PSR-16 cache implementation.","archived":false,"fork":false,"pushed_at":"2017-11-13T17:11:13.000Z","size":116,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-25T12:41:29.929Z","etag":null,"topics":["cache","flysystem","json","php7","psr-16"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/infobiotech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-05T09:26:10.000Z","updated_at":"2023-05-22T21:43:00.000Z","dependencies_parsed_at":"2022-08-21T13:50:13.039Z","dependency_job_id":null,"html_url":"https://github.com/infobiotech/php-json-cache","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infobiotech%2Fphp-json-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infobiotech%2Fphp-json-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infobiotech%2Fphp-json-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infobiotech%2Fphp-json-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infobiotech","download_url":"https://codeload.github.com/infobiotech/php-json-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244610654,"owners_count":20481031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","flysystem","json","php7","psr-16"],"created_at":"2024-11-25T17:15:07.317Z","updated_at":"2026-05-07T20:09:06.657Z","avatar_url":"https://github.com/infobiotech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![\"infobiotech logo\"](assets/logo-infobiotech-black-noclaim.png)](http://infobiotech.net?ibtref=github-readme-header)\n\n# infobiotech/php-json-cache\n\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg?style=flat-square)](https://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/infobiotech/php-json-cache/v/stable?format=flat-square)](https://packagist.org/packages/infobiotech/php-json-cache)\n[![Latest Unstable Version](https://poser.pugx.org/infobiotech/php-json-cache/v/unstable?format=flat-square)](https://packagist.org/packages/infobiotech/php-json-cache)\n[![Total Downloads](https://poser.pugx.org/infobiotech/php-json-cache/downloads?format=flat-square)](https://packagist.org/packages/infobiotech/php-json-cache)\n[![composer.lock](https://poser.pugx.org/infobiotech/php-json-cache/composerlock?format=flat-square)](https://packagist.org/packages/infobiotech/php-json-cache)\n[![License](https://poser.pugx.org/infobiotech/php-json-cache/license?format=flat-square)](https://packagist.org/packages/infobiotech/php-json-cache)\n\nA key-value JSON-based PSR-16 cache implementation.\n\nBuilt with:\n* [PHP-FIG PSR-16](http://www.php-fig.org/psr/psr-16/): a common interface for caching libraries.\n* [Psr\\SimpleCache](https://github.com/php-fig/simple-cache): a repository that holds all interfaces related to PSR-16.\n* [League\\Flysystem](https://flysystem.thephpleague.com/): a filesystem abstraction that allows to easily swap out a local filesystem for a remote one.\n\n---\n\nHere our Quality Assurance indicators for `master` git branch.\n\n|              | build status | code coverage | code quality |\n| ------------ | ------------ | ------------- | ------------ |\n| Travis CI    | [![Build Status](https://travis-ci.org/infobiotech/php-json-cache.svg?branch=master\u0026format=flat-square)](https://travis-ci.org/infobiotech/php-json-cache) | | |\n| CodeCov      |              | [![codecov](https://codecov.io/gh/infobiotech/php-json-cache/branch/master/graph/badge.svg)](https://codecov.io/gh/infobiotech/php-json-cache) | |\n| Scrutinizer  | [![Build Status](https://scrutinizer-ci.com/g/infobiotech/php-json-cache/badges/build.png?b=master)](https://scrutinizer-ci.com/g/infobiotech/php-json-cache/build-status/master) |               | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/infobiotech/php-json-cache/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/infobiotech/php-json-cache/?branch=master) |\n| Code Climate |              |               | [![Maintainability](https://api.codeclimate.com/v1/badges/15e7b0aa9a35fe0dfffe/maintainability)](https://codeclimate.com/github/infobiotech/php-json-cache/maintainability) |\n| Codacy       |              | [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/446dcd15de1647aaa0af4e0ba0d9f021)](https://www.codacy.com/app/alessandroraffa/php-json-cache?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=infobiotech/php-json-cache\u0026amp;utm_campaign=Badge_Coverage) | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/446dcd15de1647aaa0af4e0ba0d9f021)](https://www.codacy.com/app/alessandroraffa/php-json-cache?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=infobiotech/php-json-cache\u0026amp;utm_campaign=Badge_Grade) |\n\n---\n\n## Why JSON?\n\n* In some situations, remote web hosts do not support (or do not allow to install) major cache drivers.\n* JSON objects allow to set/get key-value items.\n\n## Getting Started\n\n### Prerequisites\n\n* PHP 5.6 or greater (including 7.0, 7.1 and [HHVM](https://hhvm.com/))\n\n### Installing via composer\n\nMake sure you have [composer](http://getcomposer.org/) installed.\n\nThen run the following command from your project root:\n\n```sh\n$ composer require infobiotech/php-json-cache\n```\n\n## Usage\n\n**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.\n\nHere is a simple use case:\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\n$flysystemAdapter = new League\\Flysystem\\Adapter\\Local('.');\n\n$jsonCache         = new Infobiotech\\JsonCache\\Psr16\\Driver($flysystemAdapter, uniqid());\n\n$jsonCache-\u003eset('key', 'value'); // return TRUE\n\n$jsonCache-\u003eget('key'); // return 'value'\n```\n\n### Migrations\n\n#### From v0.x to v1.x\n\nDue to a deep refactor and restructure, the instantiation code must change from this:\n\n```php\n$jsonCache = new Infobiotech\\JsonCache(/* your adapter and your namespace */);\n```\n\nto this:\n\n```php\n$jsonCache = new Infobiotech\\JsonCache\\Psr16\\Driver(/* your adapter and your namespace */);\n```\n\nThe API is unchanged.\n\n## Other PSR-16 implementations\n\n* [sabre-io/cache](https://github.com/sabre-io/cache) - In-memory, APCu and Memcached cache abstraction layer.\n* [matthiasmullie/scrapbook](https://github.com/matthiasmullie/scrapbook) - Full featured caching environment with several adapters.\n* [SilentByte/litecache](https://github.com/SilentByte/litecache) - Lightweight code/opcode caching by generating `*.php` files for cached objects.\n* [kodus/file-cache](https://github.com/kodus/file-cache) - Flat-file cache-implementation.\n* [naroga/redis-cache](https://github.com/naroga/redis-cache) - A Redis driver implementation.\n* [paillechat/apcu-simple-cache](https://github.com/paillechat/apcu-simple-cache) - APCu implementation.\n* [kodus/mock-cache](https://github.com/kodus/mock-cache) - A PSR-16 mock cache for integration testing.\n\n## Tests\n\n### Running Tests\n\nRun the following command from your project root:\n\n```sh\n$ ./vendor/bin/phpunit\n```\n\n### Running PHP Code Sniffer\n\nRun the following command from your project root:\n\n```sh\n$ ./vendor/bin/phpcs src --standard=psr2 -sp\n```\n\n## Versioning\n\nWe try to follow [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/infobiotech/php-json-cache/tags).\n\n## Authors\n\n* **Alessandro Raffa** - *Initial work* - [infobiotech](https://github.com/infobiotech)\n\n## Contributing\n\nContributions are welcome and will be credited.\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfobiotech%2Fphp-json-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfobiotech%2Fphp-json-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfobiotech%2Fphp-json-cache/lists"}