PHPackages                             php-platform/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. php-platform/json-cache

ActiveLibrary[Caching](/categories/caching)

php-platform/json-cache
=======================

v0.1.2(9y ago)02.8k↓100%1PHPPHP &gt;=5.3

Since Jan 11Pushed 8y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (1)Versions (5)Used By (1)

PHP Platform Caching JSON Meta Data
===================================

[](#php-platform-caching-json-meta-data)

Whole PHP Platform is built by using Meta Data in [JSON](http://www.json.org/) Format. This package provides caching for JSON Metadata

[![Build Status](https://camo.githubusercontent.com/d3c3dcf3bf998ae2ba011507346a44cc59b2f1bd9939c319c92a5db9562a01ac/68747470733a2f2f7472617669732d63692e6f72672f504850506c6174666f726d2f6a736f6e2d63616368652e7376673f6272616e63683d76302e31)](https://travis-ci.org/PHPPlatform/json-cache)

Usage
-----

[](#usage)

- to read from cache

```
PhpPlatform\JSONCache\Cache::getInstance()->getData($key);
```

where `$key` is string representaion of json path for required cached value

- to store in cache

```
PhpPlatform\JSONCache\Cache::getInstance()->setData($data);
```

where `$data` is an **`array`** to be stored in the cache

- to reset cache

```
PhpPlatform\JSONCache\Cache::getInstance()->reset();
```

### Extending the cache

[](#extending-the-cache)

`PhpPlatform\JSONCache\Cache` can be extended to create user defined caches

```
class NewCache extends PhpPlatform\JSONCache\Cache{

	private static $cacheObj = null;
	protected $cacheFileName = "newcachefile"; // new cache filename

	public static function getInstance(){
		if(self::$cacheObj == null){
			self::$cacheObj = new NewCache();
		}
		return self::$cacheObj;
	}
}
```

Example
-------

[](#example)

Please see the test [TestCache](https://github.com/PHPPlatform/json-cache/blob/master/tests/JSONCache/TestCache.php) for more examples

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Total

4

Last Release

3326d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/92306cd4ec1342daeba6fb633880eb9907cdd022874ae39be11ab7ae274171c7?d=identicon)[Raaghu](/maintainers/Raaghu)

---

Top Contributors

[![Raaghu](https://avatars.githubusercontent.com/u/8255650?v=4)](https://github.com/Raaghu "Raaghu (6 commits)")

---

Tags

jsonmetadatacachecachingphp-platform

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/php-platform-json-cache/health.svg)

```
[![Health](https://phpackages.com/badges/php-platform-json-cache/health.svg)](https://phpackages.com/packages/php-platform-json-cache)
```

###  Alternatives

[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
