Description
Symfony version(s) affected: symfony/cache v4.4.22
Description
After updating from symfony/cache v4.4.21 to v4.4.22, Redis suddenly stopped working. It doesn't show any message other than "Redis connection "HERE_IS_CONNECTION_STRING" failed" (it should add an error message in the end of this message).
After debugging I found out that our version of php-redis (which is 4.2.0-1) accepts 6 parameters in connect() function, while symfony/cache v4.4.22 passes 7 parameters (added TLS support). 7th parameter was added with php-redis 5.3.0 around 1 year ago.
With this change in Symfony\Component\Cache\Traits\RedisTrait, backward compability is gone.
For example, the stable version of php-redis for Debian is set to 4.2.0-1.
How to reproduce
- Install php-redis in version less than 5.3.0.
- Run RedisAdapter::createConnection($dsn)
Possible Solution
Maybe we should check for php-redis version before adding 7th argument into $redis->connect()?