Add missing docs to upgrading guide for cache config

This commit is contained in:
Damian Mooyman 2017-03-16 13:46:02 +13:00
parent 3a0099161b
commit 480597e5ff

View File

@ -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.