Skip to content

Commit c0e3284

Browse files
authored
Merge pull request #4861 from Dayoebe/master
Update APCu cache documentation example
2 parents 5483cf9 + 7db2898 commit c0e3284

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

docs/topics/memory_saving.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,24 @@ details, but here are a few suggestions that should get you started.
5353

5454
### APCu
5555

56-
Require the packages into your project:
56+
Require Symfony Cache in your project:
5757

5858
```sh
59-
composer require cache/simple-cache-bridge cache/apcu-adapter
59+
composer require symfony/cache
6060
```
6161

62+
You must also install and enable the APCu PHP extension for your environment.
63+
6264
Configure PhpSpreadsheet with something like:
6365

6466
```php
65-
$pool = new \Cache\Adapter\Apcu\ApcuCachePool();
66-
$simpleCache = new \Cache\Bridge\SimpleCache\SimpleCacheBridge($pool);
67+
use Symfony\Component\Cache\Adapter\ApcuAdapter;
68+
use Symfony\Component\Cache\Psr16Cache;
6769

68-
\PhpOffice\PhpSpreadsheet\Settings::setCache($simpleCache);
70+
$apcuAdapter = new ApcuAdapter();
71+
$cache = new Psr16Cache($apcuAdapter);
72+
73+
\PhpOffice\PhpSpreadsheet\Settings::setCache($cache);
6974
```
7075

7176
### Redis

0 commit comments

Comments
 (0)