config/packages/snc_redis.yaml. Environment-specific configurations can be managed via .env or parameter bags.cache:pool).docker-compose for Redis sidecars).cache:pool) with Redis via:
# config/packages/snc_redis.yaml
snc_redis:
clients:
default:
type: predis # or phpredis
alias: redis
dsn: redis://localhost:6379
pools:
cache_pool:
client: default
alias: cache_pool
framework:
cache:
pools:
cache_pool: ~
CacheInterface).snc_redis.yaml if PhpRedis is unavailable:
snc_redis:
clients:
default:
type: phpredis # preferred
fallback: predis
symfony/messenger).composer.json and update config/bundles.php.snc_redis.yaml for environments (dev/staging/prod).RedisClientInterface).use Snc\RedisBundle\ClientInterface;
public function __construct(private ClientInterface $redis) {}
public function getUserCache(): string {
return $this->redis->get('user:123');
}
Snc\RedisBundle\Tests\Mock\MockRedisClient.overmind or testcontainers).redis-cli --latency).snc_redis.yaml reduce duplication..env or parameter bags.snc_redis:
clients:
default:
logging: true
redis-cli or Predis\Command\Command.How can I help you explore Laravel packages today?