From 480597e5ff328050aa4259e3c353553fa1fcdc30 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Thu, 16 Mar 2017 13:46:02 +1300 Subject: [PATCH] Add missing docs to upgrading guide for cache config --- docs/en/04_Changelogs/4.0.0.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/en/04_Changelogs/4.0.0.md b/docs/en/04_Changelogs/4.0.0.md index 683ebdf8c..cb9bc7229 100644 --- a/docs/en/04_Changelogs/4.0.0.md +++ b/docs/en/04_Changelogs/4.0.0.md @@ -1599,6 +1599,7 @@ and have a slightly different API (e.g. `set()` instead of `save()`). Before: + :::php $cache = Cache::factory('myCache'); @@ -1619,6 +1620,7 @@ Before: After: + :::php use Psr\SimpleCache\CacheInterface; $cache = Injector::inst()->get(CacheInterface::class . '.myCache'); @@ -1636,6 +1638,21 @@ After: $cache->delete('myCacheKey'); + +With the necessary minimal config in `_config/mycache.yml` + + + :::yml + --- + Name: mycache + --- + SilverStripe\Core\Injector\Injector: + Psr\SimpleCache\CacheInterface.myCache: + factory: SilverStripe\Core\Cache\CacheFactory + constructor: + namespace: 'mycache' + + #### Configuration Changes Caches are now configured through dependency injection services instead of PHP.