@@ -11,6 +11,10 @@ standard, but need to pass it to an object that expects a :ref:`PSR-6 <cache-com
1111cache adapter. Or, you might have the opposite situation. The cache component contains
1212two classes for bidirectional interoperability between PSR-6 and PSR-16 caches.
1313
14+ .. versionadded :: 4.3
15+
16+ The ``Psr16Adapter `` and ``Psr16Cache `` classes mentioned below were added in Symfony 4.3.
17+
1418Using a PSR-16 Cache Object as a PSR-6 Cache
1519--------------------------------------------
1620
@@ -33,17 +37,15 @@ example::
3337
3438But, you already have a PSR-16 cache object, and you'd like to pass this to the class
3539instead. No problem! The Cache component provides the
36- :class: `Symfony\\ Component\\ Cache\\ Adapter\\ SimpleCacheAdapter ` class for exactly
40+ :class: `Symfony\\ Component\\ Cache\\ Adapter\\ Psr16Adapter ` class for exactly
3741this use-case::
3842
39- use Symfony\Component\Cache\Adapter\SimpleCacheAdapter;
40- use Symfony\Component\Cache\Simple\FilesystemCache;
43+ use Symfony\Component\Cache\Adapter\Psr16Adapter;
4144
42- // the PSR-16 cache object that you want to use
43- $psr16Cache = new FilesystemCache();
45+ // $psr16Cache is the PSR-16 object that you want to use as a PSR-6 one
4446
4547 // a PSR-6 cache that uses your cache internally!
46- $psr6Cache = new SimpleCacheAdapter ($psr16Cache);
48+ $psr6Cache = new Psr16Adapter ($psr16Cache);
4749
4850 // now use this wherever you want
4951 $githubApiClient = new GitHubApiClient($psr6Cache);
@@ -70,11 +72,11 @@ example::
7072
7173But, you already have a PSR-6 cache pool object, and you'd like to pass this to
7274the class instead. No problem! The Cache component provides the
73- :class: `Symfony\\ Component\\ Cache\\ Simple \\ Psr6Cache ` class for exactly
75+ :class: `Symfony\\ Component\\ Cache\\ Psr16Cache ` class for exactly
7476this use-case::
7577
7678 use Symfony\Component\Cache\Adapter\FilesystemAdapter;
77- use Symfony\Component\Cache\Simple\Psr6Cache ;
79+ use Symfony\Component\Cache\Psr16Cache ;
7880
7981 // the PSR-6 cache object that you want to use
8082 $psr6Cache = new FilesystemAdapter();
0 commit comments