11# Cache Engine
22
3- [ ![ Build Status] ( https://github.com/byjg/cache-engine-php /actions/workflows/phpunit.yml/badge.svg?branch=master )] ( https://github.com/byjg/cache-engine-php /actions/workflows/phpunit.yml )
3+ [ ![ Build Status] ( https://github.com/byjg/php- cache-engine/actions/workflows/phpunit.yml/badge.svg?branch=master )] ( https://github.com/byjg/php- cache-engine/actions/workflows/phpunit.yml )
44[ ![ Opensource ByJG] ( https://img.shields.io/badge/opensource-byjg-success.svg )] ( http://opensource.byjg.com )
5- [ ![ GitHub source] ( https://img.shields.io/badge/Github-source-informational?logo=github )] ( https://github.com/byjg/cache-engine-php / )
6- [ ![ GitHub license] ( https://img.shields.io/github/license/byjg/cache-engine-php .svg )] ( https://opensource.byjg.com/opensource/licensing.html )
7- [ ![ GitHub release] ( https://img.shields.io/github/release/byjg/cache-engine-php .svg )] ( https://github.com/byjg/cache-engine-php /releases/ )
5+ [ ![ GitHub source] ( https://img.shields.io/badge/Github-source-informational?logo=github )] ( https://github.com/byjg/php- cache-engine/ )
6+ [ ![ GitHub license] ( https://img.shields.io/github/license/byjg/php- cache-engine.svg )] ( https://opensource.byjg.com/opensource/licensing.html )
7+ [ ![ GitHub release] ( https://img.shields.io/github/release/byjg/php- cache-engine.svg )] ( https://github.com/byjg/php- cache-engine/releases/ )
88
99
1010A multi-purpose cache engine PSR-6 and PSR-16 implementation with several drivers.
@@ -95,12 +95,34 @@ You can add a PSR Log compatible to the constructor in order to get Log of the o
9595
9696See log examples [ here] ( docs/setup-log-handler.md )
9797
98+ ## Use a PSR-11 container to retrieve the cache keys
99+
100+ You can use a PSR-11 compatible to retrieve the cache keys. Once is defined, only the keys defined
101+ in the PSR-11 will be used to cache.
102+
103+ ``` php
104+ <?php
105+ $fileCache = new \ByJG\Cache\Psr16\FileSystemCacheEngine()
106+ $fileCache->withKeysFromContainer(new SomePsr11Implementation());
107+ ```
108+
109+ After the PSR-11 container is defined, when I run:
110+
111+ ``` php
112+ $value = $fileCache->get('my-key');
113+ ```
114+
115+ The key ` my-key ` will be retrieved from the PSR-11 container and
116+ the value retrieved will be used as the cache key.
117+ If it does not exist in the PSR-11 container, an exception will be thrown.
118+
119+
98120## Install
99121
100122Just type:
101123
102124```
103- composer require "byjg/cache-engine=4.9.* "
125+ composer require "byjg/cache-engine"
104126```
105127
106128
@@ -112,5 +134,14 @@ vendor/bin/phpunit --stderr
112134
113135** Note:** the parameter ` --stderr ` after ` phpunit ` is to permit run the tests on SessionCacheEngine.
114136
137+ ## Dependencies
138+
139+ ``` mermaid
140+ flowchart TD
141+ byjg/cache-engine --> psr/cache
142+ byjg/cache-engine --> psr/log
143+ byjg/cache-engine --> psr/simple-cache
144+ byjg/cache-engine --> psr/container
145+ ```
115146----
116147[ Open source ByJG] ( http://opensource.byjg.com )
0 commit comments