mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Add missing docs to upgrading guide for cache config
This commit is contained in:
parent
3a0099161b
commit
480597e5ff
@ -1599,6 +1599,7 @@ and have a slightly different API (e.g. `set()` instead of `save()`).
|
|||||||
|
|
||||||
Before:
|
Before:
|
||||||
|
|
||||||
|
|
||||||
:::php
|
:::php
|
||||||
$cache = Cache::factory('myCache');
|
$cache = Cache::factory('myCache');
|
||||||
|
|
||||||
@ -1619,6 +1620,7 @@ Before:
|
|||||||
|
|
||||||
After:
|
After:
|
||||||
|
|
||||||
|
|
||||||
:::php
|
:::php
|
||||||
use Psr\SimpleCache\CacheInterface;
|
use Psr\SimpleCache\CacheInterface;
|
||||||
$cache = Injector::inst()->get(CacheInterface::class . '.myCache');
|
$cache = Injector::inst()->get(CacheInterface::class . '.myCache');
|
||||||
@ -1636,6 +1638,21 @@ After:
|
|||||||
|
|
||||||
$cache->delete('myCacheKey');
|
$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
|
#### Configuration Changes
|
||||||
|
|
||||||
Caches are now configured through dependency injection services instead of PHP.
|
Caches are now configured through dependency injection services instead of PHP.
|
||||||
|
Loading…
Reference in New Issue
Block a user