Skip to content

Commit d8070fc

Browse files
B-GalatiNyholm
authored andcommitted
Symfony support SimpleCache since 3.3 (#193)
1 parent 474afc3 commit d8070fc

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Resources/doc/cache.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,17 @@ You may use any adapter from [PHP-cache.com](http://www.php-cache.com/en/latest/
5151

5252
## Using Symfony cache
5353

54-
Symfony 3.3 does not support SimpleCache, but fear not. You can use a bridge between PSR-6 and PSR-16. Install the
55-
[bridge](https://github.com/php-cache/simple-cache-bridge) by:
56-
57-
```bash
58-
composer require cache/simple-cache-bridge
59-
```
60-
61-
Then register a service:
54+
Symfony>=3.3 supports SimpleCache thanks to `Symfony\Component\Cache\Simple\Psr6Cache` adapter.
55+
Thus a service can be registered like so:
6256

6357
```yaml
6458
# services.yml
6559
app.simple_cache:
66-
class: Cache\Bridge\SimpleCache\SimpleCacheBridge
60+
class: Symfony\Component\Cache\Simple\Psr6Cache
6761
arguments: ['@app.cache.acme']
6862
```
6963

70-
Then configure the framework and the bundle.
64+
Then configure the framework and the bundle:
7165

7266
```yaml
7367
# config.yml
@@ -87,3 +81,11 @@ bazinga_geocoder:
8781
cache_lifetime: 3600
8882
```
8983

84+
For older Symfony version, you can use a bridge between PSR-6 and PSR-16. Install the
85+
[bridge](https://github.com/php-cache/simple-cache-bridge) by:
86+
87+
```bash
88+
composer require cache/simple-cache-bridge
89+
```
90+
91+
Then, in the service declaration you can use `Cache\Bridge\SimpleCache\SimpleCacheBridge` instead of `Symfony\Component\Cache\Simple\Psr6Cache`.

0 commit comments

Comments
 (0)