mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-30 20:18:00 +00:00
Merge pull request #4861 from Dayoebe/master
Update APCu cache documentation example
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user