Namoshek / laravel-redis-sentinel

An extension of Laravels Redis driver which supports connecting to a Redis master through Redis Sentinel.
MIT License
20 stars 17 forks source link

Add support for PhpRedis 6.0 #20

Closed OrangeJuiced closed 1 year ago

OrangeJuiced commented 1 year ago

PhpRedis 6.0 changes the RedisSentinel constructor. This PR changes how configuration is passed to constructor for PhpRedis 6.0. See: https://github.com/phpredis/phpredis/commit/ebb2386e52c9ddd8a45e3cd67f12d77be894e1d7#diff-a1471159ac00556a439382b010c89a8507ebc6f03311ec7655cebd95dc6c978e

Namoshek commented 1 year ago

I'll need to have a thorough look at this as it might have a dependency on the extened Laravel driver for Redis. If possible, we should also consider supporting both syntaxes via version check?

OrangeJuiced commented 1 year ago

Sounds good! I added a version check to support both >= 6.0 and < 6.0.

Namoshek commented 1 year ago

The whole security of GitHub Actions secrets and the SonarQube analysis is annoying me, but the changes look fine now. I've simplified the constructor call for the new version though as we can now simply add the auth array element when needed.

And released as v0.3.0. Thanks!