Download the PHP package angelxmoreno/cakephp-simplecache-bridge without Composer
On this page you can find all versions of the php package angelxmoreno/cakephp-simplecache-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download angelxmoreno/cakephp-simplecache-bridge
More information about angelxmoreno/cakephp-simplecache-bridge
Files in angelxmoreno/cakephp-simplecache-bridge
Package cakephp-simplecache-bridge
Short Description A bridge to convert CakePHP Cache to SimpleCache (PSR16)
License MIT
Homepage https://github.com/angelxmoreno/cakephp-simplecache-bridge
Informations about the package cakephp-simplecache-bridge
CakePHP SimpleCache Bridge
A bridge to convert CakePHP Cache to SimpleCache (PSR16)
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 ?
~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 for the clarification.
Examples
Requirements
- PHP >=5.6
- CakePHP >=3.0
Installation
You can install this library using composer.
The recommended way to install as a composer package:
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:
Reporting Issues
If you have a problem with this library please open an issue on GitHub.
License
This code is offered under an MIT license.