Closed mocxi closed 8 months ago
Hello curious contributor ! Since it seems to be your first contribution, make sure that you've been:
Hello, could be implemented as of 9.2 version as a new feature indeed.
I'm using phpfastcache v7
Just FYI @mocxi, v7 is no longer supported, upgrade at least to v8 for security fixes support or v9 for extended support:
https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV4%CB%96%5D-Global-support-timeline
RedisCluster Class have some different signatures than Redis Class.
So I think that I will may create a new driver that extends the Redis one.
Can you test the 9.2 dev branch v9.2.x-dev
please and telle me if you make it working ?
Syntax:
use Phpfastcache\Drivers\RedisCluster\Config as RedisConfig;
use Phpfastcache\CacheManager;
$config = new RedisConfig();
$config->setClusters( '127.0.0.1:7001', '127.0.0.1:7002', '127.0.0.1:7003', '127.0.0.1:7004', '127.0.0.1:7005', '127.0.0.1:7006');
$config->setOptPrefix('pfc_');; // optional
$config->setSlaveFailover(\RedisCluster::FAILOVER_ERROR); // optional
$cacheInstance = CacheManager::getInstance('RedisCluster', $config);
It worked as intended. Thanks for your help!
Everything looks good for you ? You managed to configure it easily @mocxi ?
Btw 9.2 should be shipped by January.
Yes, I pulled the dev branch, set up a Redis cluster, connected to it and everything is good. The thing now is I need to upgrade my code base to PHP 8 in order to use the latest 9.x phpfastcache
What type of feature would you like?
New backend support
The feature request
The current set function
new RedisConfig())->setRedisClient($redisClient)
only accept Redis object I'd like to request supportRedisCluster
so I can set custom native redis cluster client for itCode sample (optional)
References (optional)
https://github.com/phpredis/phpredis/blob/develop/cluster.md
Do you have anything more you want to share? (optional)
I'm using phpfastcache v7