PHPackages                             alejoasotelo/joomla-cache-compat - 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. [Framework](/categories/framework)
4. /
5. alejoasotelo/joomla-cache-compat

ActiveJoomla-package[Framework](/categories/framework)

alejoasotelo/joomla-cache-compat
================================

Joomla Cache Package - PSR Compatbility

1.2.1(6y ago)1100↓77.8%GPL-2.0-or-laterPHPPHP ^5.3.10|~7.0

Since Jun 4Pushed 6y agoCompare

[ Source](https://github.com/alejoasotelo/joomla-cache-compat)[ Packagist](https://packagist.org/packages/alejoasotelo/joomla-cache-compat)[ Docs](https://github.com/joomla-framework/cache)[ RSS](/packages/alejoasotelo-joomla-cache-compat/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (15)Used By (0)

The Cache Package [![Build Status](https://camo.githubusercontent.com/4fe4c9a52a127771ddedfb0cbd3345acfeb17ff0db7d321623d99ff441fabd37/68747470733a2f2f7472617669732d63692e6f72672f6a6f6f6d6c612d6672616d65776f726b2f63616368652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/joomla-framework/cache)
===================================================================================================================================================================================================================================================================================================================

[](#the-cache-package-)

[![Latest Stable Version](https://camo.githubusercontent.com/743b836bb1560f4a50a6acbd250272a33183da1d667ee534bb4f27de6cd15429/68747470733a2f2f706f7365722e707567782e6f72672f616c656a6f61736f74656c6f2f6a6f6f6d6c612d63616368652d636f6d7061742f762f737461626c65)](https://packagist.org/packages/alejoasotelo/joomla-cache-compat)[![Total Downloads](https://camo.githubusercontent.com/df092cbcf706c968fa999c70e94cf248d4efc73dbb3cca7bd5ad9ec8125a3b9b/68747470733a2f2f706f7365722e707567782e6f72672f616c656a6f61736f74656c6f2f6a6f6f6d6c612d63616368652d636f6d7061742f646f776e6c6f616473)](https://packagist.org/packages/alejoasotelo/joomla-cache-compat)[![Latest Unstable Version](https://camo.githubusercontent.com/3b0e831f879f38789e8b28d03a8163280782a31c886267a6ffbd2693751f6b64/68747470733a2f2f706f7365722e707567782e6f72672f616c656a6f61736f74656c6f2f6a6f6f6d6c612d63616368652d636f6d7061742f762f756e737461626c65)](https://packagist.org/packages/alejoasotelo/joomla-cache-compat)[![License](https://camo.githubusercontent.com/8dcb7a713223c15a213dbb4fe24012266c8725f974f879fb16b1b6d7a3c2562b/68747470733a2f2f706f7365722e707567782e6f72672f616c656a6f61736f74656c6f2f6a6f6f6d6c612d63616368652d636f6d7061742f6c6963656e7365)](https://packagist.org/packages/alejoasotelo/joomla-cache-compat)

This cache package is based on a version of the now accepted PSR-6 as it was in 2013.

Deprecated
----------

[](#deprecated)

The `alejoasotelo/joomla-cache-compat` package has been deprecated with no further updates planned.

Options and General Usage
-------------------------

[](#options-and-general-usage)

Following option as available across a cache storage types:

- ttl - Time to live.

```
use Joomla\Cache;

$options = array(
	'ttl' => 900,
);

$cache = new Cache\Runtime($options);

// Set a value in the cache.
$cache->set('key', 'value');

// Get the value back.
$value = $cache->get('key')->getValue();

// Remove the item from the cache.
$cache->remove('key');

// Clear all the items from the cache.
$cache->clear();

// Get multiple values from the cache at once.
$values = $cache->getMultiple(array('key1', 'key2'));

// Set multiple values from the cache at once.
$values = $cache->setMultiple(array('key1' => 'value1', 'key2' => 'value2'));

// Remove multiple values from the cache at once.
$values = $cache->removeMultiple(array('key1', 'key2'));
```

Cache Storage Types
-------------------

[](#cache-storage-types)

The following storage types are supported.

### Apc

[](#apc)

```
use Joomla\Cache;

$cache = new Cache\Apc;
```

### File

[](#file)

The **File** cache allows the following additional options:

- file.path - the path where the cache files are to be stored.
- file.locking

```
use Joomla\Cache;

$options = array(
	'file.path' => __DIR__ . '/cache',
);

$cache = new Cache\File($options);
```

### Memcached

[](#memcached)

```
use Joomla\Cache;

$cache = new Cache\Memcached;
```

### None

[](#none)

```
use Joomla\Cache;

$cache = new Cache\None;
```

### Runtime

[](#runtime)

```
use Joomla\Cache;

$cache = new Cache\Runtime;
```

### Wincache

[](#wincache)

```
use Joomla\Cache;

$cache = new Cache\Wincache;
```

### XCache

[](#xcache)

```
use Joomla\Cache;

$cache = new Cache\XCache;
```

Test Mocking
------------

[](#test-mocking)

The `Cache` package provide a **PHPUnit** helper to mock a `Cache\Cache` object or an `Cache\Item` object. You can include your own optional overrides in the test class for the following methods:

- `Cache\Cache::get`: Add a method called `mockCacheGet` to your test class. If omitted, the helper will return a default mock for the `Cache\Item` class.
- `Cache\Item::getValue`: Add a method called `mockCacheItemGetValue` to your test class. If omitted, the mock `Cache\Item` will return `"value"` when this method is called.
- `Cache\Item::isHit`: Add a method called `mockCacheItemIsHit` to your test class. If omitted, the mock `Cache\Item` will return `false` when this method is called.

```
use Joomla\Cache\Tests\Mocker as CacheMocker;

class FactoryTest extends \PHPUnit_Framework_TestCase
{
	private $instance;

	//
	// The following mocking methods are optional.
	//

	/**
	 * Callback to mock the Cache\Item::getValue method.
	 *
	 * @return  string
	 */
	public function mockCacheItemGetValue()
	{
		// This is the default handling.
		// You can override this method to provide a custom return value.
		return 'value';
	}

	/**
	 * Callback to mock the Cache\Item::isHit method.
	 *
	 * @return  boolean
	 */
	public function mockCacheItemIsHit()
	{
		// This is the default handling.
		// You can override this method to provide a custom return value.
		return false;
	}

	/**
	 * Callback to mock the Cache\Cache::get method.
	 *
	 * @param   string  $text  The input text.
	 *
	 * @return  string
	 */
	public function mockCacheGet($key)
	{
		// This is the default handling.
		// You can override this method to provide a custom return value.
		return $this->createMockItem();
	}

	protected function setUp()
	{
		parent::setUp();

		$mocker = new CacheMocker($this);

		$this->instance = new SomeClass($mocker->createMockCache());
	}
}
```

Installation via Composer
-------------------------

[](#installation-via-composer)

Add `"alejoasotelo/joomla-cache-compat": "~1.0"` to the require block in your composer.json and then run `composer install`.

```
{
	"require": {
		"alejoasotelo/joomla-cache-compat": "~1.0"
	}
}
```

Alternatively, you can simply run the following from the command line:

```
composer require alejoasotelo/joomla-cache-compat "~1.0"
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~198 days

Recently: every ~484 days

Total

13

Last Release

2386d ago

PHP version history (2 changes)1.0-alphaPHP &gt;=5.3.10

1.1.5PHP ^5.3.10|~7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/94548f0e97e58577c351e6f1a225ae2a56983d9791a6e1c5cd570a968517ed98?d=identicon)[alejoasotelo](/maintainers/alejoasotelo)

---

Top Contributors

[![mbabker](https://avatars.githubusercontent.com/u/368545?v=4)](https://github.com/mbabker "mbabker (46 commits)")[![dongilbert](https://avatars.githubusercontent.com/u/718028?v=4)](https://github.com/dongilbert "dongilbert (13 commits)")[![aliasm2k](https://avatars.githubusercontent.com/u/29655345?v=4)](https://github.com/aliasm2k "aliasm2k (11 commits)")[![Achal-Aggarwal](https://avatars.githubusercontent.com/u/3330262?v=4)](https://github.com/Achal-Aggarwal "Achal-Aggarwal (11 commits)")[![JindrichPilar](https://avatars.githubusercontent.com/u/2984399?v=4)](https://github.com/JindrichPilar "JindrichPilar (3 commits)")[![alejoasotelo](https://avatars.githubusercontent.com/u/1103289?v=4)](https://github.com/alejoasotelo "alejoasotelo (3 commits)")[![realityking](https://avatars.githubusercontent.com/u/628508?v=4)](https://github.com/realityking "realityking (2 commits)")[![gamort](https://avatars.githubusercontent.com/u/15091656?v=4)](https://github.com/gamort "gamort (1 commits)")[![ianmacl](https://avatars.githubusercontent.com/u/176534?v=4)](https://github.com/ianmacl "ianmacl (1 commits)")[![frankmayer](https://avatars.githubusercontent.com/u/825497?v=4)](https://github.com/frankmayer "frankmayer (1 commits)")[![eddieajau](https://avatars.githubusercontent.com/u/700871?v=4)](https://github.com/eddieajau "eddieajau (1 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (1 commits)")[![photodude](https://avatars.githubusercontent.com/u/10253980?v=4)](https://github.com/photodude "photodude (1 commits)")[![asika32764](https://avatars.githubusercontent.com/u/1639206?v=4)](https://github.com/asika32764 "asika32764 (1 commits)")

---

Tags

frameworkcachejoomla

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alejoasotelo-joomla-cache-compat/health.svg)

```
[![Health](https://phpackages.com/badges/alejoasotelo-joomla-cache-compat/health.svg)](https://phpackages.com/packages/alejoasotelo-joomla-cache-compat)
```

###  Alternatives

[utopia-php/cache

A simple cache library to manage application cache storing, loading and purging

31447.6k15](/packages/utopia-php-cache)[joomla/application

Joomla Application Package

23430.4k13](/packages/joomla-application)[joomla/registry

Joomla Registry Package

16505.8k21](/packages/joomla-registry)[joomla/filesystem

Joomla Filesystem Package

11394.8k7](/packages/joomla-filesystem)[joomla/oauth2

Joomla OAuth2 Package

10326.4k2](/packages/joomla-oauth2)[yiisoft/cache-redis

Yii Caching Library - Redis Handler

1014.8k1](/packages/yiisoft-cache-redis)

PHPackages © 2026

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