Merge pull request #4861 from Dayoebe/master

Update APCu cache documentation example
This commit is contained in:
oleibman
2026-04-26 21:13:23 +00:00
committed by GitHub
+10 -5
View File
@@ -53,19 +53,24 @@ details, but here are a few suggestions that should get you started.
### APCu
Require the packages into your project:
Require Symfony Cache in your project:
```sh
composer require cache/simple-cache-bridge cache/apcu-adapter
composer require symfony/cache
```
You must also install and enable the APCu PHP extension for your environment.
Configure PhpSpreadsheet with something like:
```php
$pool = new \Cache\Adapter\Apcu\ApcuCachePool();
$simpleCache = new \Cache\Bridge\SimpleCache\SimpleCacheBridge($pool);
use Symfony\Component\Cache\Adapter\ApcuAdapter;
use Symfony\Component\Cache\Psr16Cache;
\PhpOffice\PhpSpreadsheet\Settings::setCache($simpleCache);
$apcuAdapter = new ApcuAdapter();
$cache = new Psr16Cache($apcuAdapter);
\PhpOffice\PhpSpreadsheet\Settings::setCache($cache);
```
### Redis