Provide Adapters for TYPO3 to be compatible with PSR-6

Installs: 12 969

Dependents: 3

Suggesters: 0

Security: 0

Stars: 3

Watchers: 3

Forks: 1

Open Issues: 2


v1.2.2 2023-12-08 11:29 UTC


Provide a PSR-6 and PSR-16 compatible cache adapter for the TYPO3 Caching Framework.


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->set('cache.psr6.typo3_psr_cache_adapter_test', CacheItemPoolInterface::class)
        ->factory([service(Psr6Factory::class), 'create'])

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.