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.