An implementation of the PSR Cache interface for Redis

1.0.0 2022-01-04 23:38 UTC

This package is auto-updated.

Last update: 2023-05-05 02:34:45 UTC



// Create a Redis instance
$redis = new \Redis();

// Create the RedisCacheItemPool and send it the redis instance
$cacheItemPool = new \BuzzingPixel\RedisCache\RedisCacheItemPool($redis);

And here's an example of configuring the BuzzingPixel Container to use the RedisCacheItemPool by default when auto-wiring the PSR CacheItemPoolInterface (other containers can be configured similarly).

$container = new \BuzzingPixel\Container\Container(
    bindings: [
        \Psr\Cache\CacheItemPoolInterface::class => \BuzzingPixel\RedisCache\RedisCacheItemPool::class,
        \Redis::class => static function (): \Redis {
            $redis = new \Redis();
            return $redis;