diff --git a/CHANGELOG.md b/CHANGELOG.md index 54393321..6a95b95b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ Examples: * [PR #59](https://github.com/SonsOfPHP/sonsofphp/pull/59) Added new HttpMessage component * [PR #59](https://github.com/SonsOfPHP/sonsofphp/pull/59) Added new HttpFactory component * [PR #70](https://github.com/SonsOfPHP/sonsofphp/pull/70) Added new Core contract +* [PR #112](https://github.com/SonsOfPHP/sonsofphp/pull/112) [Cache] Added new component ## [0.3.8] diff --git a/docs/components/cache/index.md b/docs/components/cache/index.md index ebb4b4f4..0e7b1894 100644 --- a/docs/components/cache/index.md +++ b/docs/components/cache/index.md @@ -9,3 +9,58 @@ Used for cache stuff ```shell composer require sonsofphp/cache ``` + +### PSR-16 - Simple Cache + +To add support for PSR-16 Simple Cache, require the PSR. + +```shell +composer require psr/simple-cache +``` + +## Usage + +```php +adapters[0]->getItem($key); + foreach ($this->adapters as $adapter) { + if ($adapter->hasItem($key)) { + return $adapter->getItem($key); + } + } + + return new CacheItem($key, false); } /**