Closed dol closed 6 years ago
Hello,
This is a known limitation of the (P)redis driver and won't be done in v6 which is now stable. However this could be eventually studied for the v7.
Cheers, Georges
@dol This should do the job. Test it please, so I can make some automated tests on my side too. Thanks. N.b: This has been only implemented for Predis/Redis clients for now. I will may considerate implementing it to other drivers in the future.
@dol Bump :P
The issue has been fixed, thanks you for your contribution :thumbsup:
Geolim4
@Geolim4 Thank you for implementing this. I was able to the implementation and I confirm it's working as excepted.
Configuration:
PhpFastCache version:
6.*
PHP version:PHP 7.0
Issue description:
The predis client can also be used with a Redis cluster/sentinel setup. https://github.com/nrk/predis#cluster The current implementation and also v7 doesn't allow to use more than one server. https://github.com/PHPSocialNetwork/phpfastcache/blob/411cf0ad87a52ab93ae31ba07820111a5ebbf022/src/phpFastCache/Drivers/Predis/Driver.php#L157
To allow all the possible predis settings the configurations parameters need to be passed to the client initialization. In v6 and v7 this is not possible due to a limited set of configuration settings and that are merge with the default settings. One solution could be to pass the raw
$parameters
and$options
to the client initialization inside the driver or the add a new config parameter that allows a already Predis client object. E.g: