PHPackages                             angelxmoreno/cakephp-simplecache-bridge - 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. angelxmoreno/cakephp-simplecache-bridge

ActiveLibrary[Caching](/categories/caching)

angelxmoreno/cakephp-simplecache-bridge
=======================================

A bridge to convert CakePHP Cache to SimpleCache (PSR16)

v1.0.2(7y ago)064MITPHPPHP ^5.6 || ^7

Since Sep 15Pushed 7y ago1 watchersCompare

[ Source](https://github.com/angelxmoreno/cakephp-simplecache-bridge)[ Packagist](https://packagist.org/packages/angelxmoreno/cakephp-simplecache-bridge)[ Docs](https://github.com/angelxmoreno/cakephp-simplecache-bridge)[ RSS](/packages/angelxmoreno-cakephp-simplecache-bridge/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (8)Versions (4)Used By (0)

CakePHP SimpleCache Bridge
==========================

[](#cakephp-simplecache-bridge)

A bridge to convert CakePHP Cache to SimpleCache (PSR16)

[![Build Status](https://camo.githubusercontent.com/484461118f9e31391c14849809dffa5a2dd0ad3c4b0c6ae9bce456a9f3d5d423/68747470733a2f2f7472617669732d63692e636f6d2f616e67656c786d6f72656e6f2f63616b657068702d73696d706c6563616368652d6272696467652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/angelxmoreno/cakephp-simplecache-bridge)[![Codacy Badge](https://camo.githubusercontent.com/78205c2da5bb2a63e43d01bf3cef5ec23c1faa6a6895cf9581809be58440412f/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6537336334666233373933363439643138623030353539356662346565373064)](https://www.codacy.com/app/angelxmoreno/cakephp-simplecache-bridge?utm_source=github.com&utm_medium=referral&utm_content=angelxmoreno/cakephp-simplecache-bridge&utm_campaign=Badge_Grade)[![Maintainability](https://camo.githubusercontent.com/64fe659d44c82e3adf6fc4eb9ff52bf6e0b3ef7f0d95c3486f93469d28f7d34f/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f35646639316335306461333963373232613031302f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/angelxmoreno/cakephp-simplecache-bridge/maintainability)[![Test Coverage](https://camo.githubusercontent.com/6d3f04266fe3ab8ce5dcae33c8aa18bc6535616a70d76b3e80b54f02f407c854/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f35646639316335306461333963373232613031302f746573745f636f766572616765)](https://codeclimate.com/github/angelxmoreno/cakephp-simplecache-bridge/test_coverage)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)[![Minimum PHP Version](https://camo.githubusercontent.com/e97290c4047b8fc1152177fc8110cab416f31f18159b722b6b633a210a198861/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e362d3838393242462e737667)](https://php.net/)

Why build this?
---------------

[](#why-build-this)

In a few of my CakePHP apps I make use of 3rd party libraries that require a PSR-16 compatible cache engine. This bridge allows me to reuse the Cache Engines and Cache configs already available within my CakePHP application and eliminates the need of having to build 2 different sets of Cache management libraries.

Isn't this already in CakePHP 3.7 ?
-----------------------------------

[](#isnt-this-already-in-cakephp-37-)

No. CakePHP 3.7 brings with it a PSR-16 CacheEngine; meaning you will be able to decorate a PSR-16 object to implement `Cake\Cache\CacheEngine` methods. What this bridge offers is the ability to go from a `Cake\Cache\CacheEngine` to PSR-16, not the other way around.

*The new `SimpleCacheEngine` class ( in CakePHP 3.7 ) implements PSR 16 interface and decorates/wraps `CacheEngine` classes.*

Thanks [Admad](https://github.com/ADmad) for the clarification.

Examples
--------

[](#examples)

```
Cache::config('short', [
    'className' => 'File',
    'duration' => '+1 hours',
    'path' => CACHE,
    'prefix' => 'cake_short_'
]);

$cache = new Bridge('short');

//setting cache data
$cache->set('some_key', 'some value');

//getting cache data with a default
$value = $cache->get('some_key', 'some default');

//overriding the Cache engine's TTL with an int
$cache->set('some_key', 'some value', 300); //cached for 300 seconds instead of `+1 hours`

//overriding the Cache engine's TTL with a `\DateTimeInterval` ( as per the SimpleCache Interface )
$interval = new \DateTimeInterval('P1Y'); // an interval of 1 year
$cache->set('some_key', 'some value', $interval); //cached for 1 year instead of `+1 hours`
```

Requirements
------------

[](#requirements)

- PHP &gt;=5.6
- CakePHP &gt;=3.0

Installation
------------

[](#installation)

You can install this library using [composer](http://getcomposer.org).

The recommended way to install as a composer package:

```
composer require angelxmoreno/cakephp-simplecache-bridge
```

Setup
-----

[](#setup)

Once you have a cahe configuration defined, you simple have to pass the config name when creating an instance of the Bridge like so:

```
Cache::config('short', [
    'className' => 'File',
    'duration' => '+1 hours',
    'path' => CACHE,
    'prefix' => 'cake_short_'
]);

$cache = new Bridge('short');
```

Reporting Issues
----------------

[](#reporting-issues)

If you have a problem with this library please open an issue on [GitHub](https://github.com/angelxmoreno/cakephp-simplecache-bridge/issues).

License
-------

[](#license)

This code is offered under an [MIT license](https://opensource.org/licenses/mit-license.php).

###  Health Score

26

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Total

3

Last Release

2744d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58aebae1bf475954887c4c975a24950aa32c0dd34026400fa0303f7a43672389?d=identicon)[angelxmoreno](/maintainers/angelxmoreno)

---

Top Contributors

[![angelxmoreno](https://avatars.githubusercontent.com/u/363479?v=4)](https://github.com/angelxmoreno "angelxmoreno (5 commits)")

---

Tags

cachecakephpcakephp3psr-16simplecachecakephpcachepsr-16cakephp3simplecache

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/angelxmoreno-cakephp-simplecache-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/angelxmoreno-cakephp-simplecache-bridge/health.svg)](https://phpackages.com/packages/angelxmoreno-cakephp-simplecache-bridge)
```

###  Alternatives

[laminas/laminas-cache

Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output

1066.7M108](/packages/laminas-laminas-cache)[cache/simple-cache-bridge

A PSR-6 bridge to PSR-16. This will make any PSR-6 cache compatible with SimpleCache.

433.1M24](/packages/cache-simple-cache-bridge)[sabre/cache

Simple cache abstraction layer implementing PSR-16

541.2M2](/packages/sabre-cache)[codeigniter4/cache

PSR-6 and PSR-16 Cache Adapters for CodeIgniter 4

1319.5k](/packages/codeigniter4-cache)[chillerlan/php-cache

A psr/simple-cache implementation. PHP 8.1+

15208.5k8](/packages/chillerlan-php-cache)[webarchitect609/bitrix-cache

Comfortable fluent interface for Bitrix cache. Anti-stampede cache protection.

2731.1k8](/packages/webarchitect609-bitrix-cache)

PHPackages © 2026

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