ssch / typo3-psr-cache-adapter
Provide Adapters for TYPO3 to be compatible with PSR-6
Fund package maintenance!
sabbelasichon
paypal.me/schreiberten
Installs: 17 224
Dependents: 3
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 1
Open Issues: 2
Type:typo3-cms-extension
Requires
- php: ^7.4 || ^8.0
- psr/cache: ^1.0 || ^2.0
- psr/simple-cache: ^1.0
- typo3/cms-core: ^10.4 || ^11.4 || ^12.4
Requires (Dev)
- php-parallel-lint/php-parallel-lint: ^1.3
- phpstan/extension-installer: ^1.2
- phpstan/phpstan: ^1.8
- phpstan/phpstan-phpunit: ^1.2
- phpstan/phpstan-strict-rules: ^1.4
- saschaegerer/phpstan-typo3: ^1.8
- symplify/easy-coding-standard: ^12.0
- typo3/testing-framework: ^6.16 || ^7.0
Provides
- psr/cache-implementation: 2.0 || 3.0
- psr/simple-cache-implementation: 1.0
This package is auto-updated.
Last update: 2024-10-08 13:12:52 UTC
README
Provide a PSR-6 and PSR-16 compatible cache adapter for the TYPO3 Caching Framework.
Usage
To ease the creation of a PSR-6 or PSR-16 compatible cache object the extension ships with two factories.
One for PSR-6 and one for PSR-16.
Create either a PSR-6 or a PSR-16 compatible cache object with leveraging Symfony DI configuration:
use Psr\Cache\CacheItemPoolInterface; use Ssch\Cache\Factory\Psr6Factory; use MyNamespace\MyExtensionKey\Service\MyService; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use function Symfony\Component\DependencyInjection\Loader\Configurator\service; return static function (ContainerConfigurator $containerConfigurator): void { $services = $containerConfigurator->services(); $services->defaults() ->autowire() ->private() ->autoconfigure(); $services->set('cache.psr6.typo3_psr_cache_adapter_test', CacheItemPoolInterface::class) ->factory([service(Psr6Factory::class), 'create']) ->args(['typo3_psr_cache_adapter_test']); $services->set(MyService::class) ->args([service('cache.psr6.typo3_psr_cache_adapter_test')]); };
Note the typo3_psr_cache_adapter_test. This is the cache identifier you have used to configure your TYPO3 Cache for the TYPO3 Caching Framework.