-
-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom native RedisCluster client #906
Comments
Hello curious contributor !
|
Hello, could be implemented as of 9.2 version as a new feature indeed. |
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. |
- __API__ - Upgraded Phpfastcache API to `4.3.0` ([see changes](CHANGELOG_API.md)) - __Drivers__ - Implemented #906 // **Added `RedisCluster` driver support** - __Pool__ - Added `ExtendedCacheItemPoolTrait::getAllItems` to allow you to retrieve all items in the cache. This method have some limitations, ([see more in the Wiki](https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV5%CB%96%5D-Fetching-all-keys)). - __Core__ - Configuration methods`ConfigurationOption::isPreventCacheSlams()`, `ConfigurationOption::setPreventCacheSlams()`, `ConfigurationOption::getCacheSlamsTimeout()`, `ConfigurationOption::setCacheSlamsTimeout()` are deprecated. ([See changes](CHANGELOG_API.md)). - Fixed #907 // Internal "driver decode()" method will now throw an if the string data looks corrupted. - Internal: Implemented multiple keys fetch (*if supported by the backend*) to improve the performances behind all `getItems()` calls. Currently only supported in some backends, but it may evolve in the future. - __Misc__ - Fixed multiple code typo & updated README.md
- __API__ - Upgraded Phpfastcache API to `4.3.0` ([see changes](CHANGELOG_API.md)) - __Drivers__ - Implemented #906 // **Added `RedisCluster` driver support** - __Pool__ - Added `ExtendedCacheItemPoolTrait::getAllItems` to allow you to retrieve all items in the cache. This method have some limitations, ([see more in the Wiki](https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV5%CB%96%5D-Fetching-all-keys)). - __Core__ - Configuration methods`ConfigurationOption::isPreventCacheSlams()`, `ConfigurationOption::setPreventCacheSlams()`, `ConfigurationOption::getCacheSlamsTimeout()`, `ConfigurationOption::setCacheSlamsTimeout()` are deprecated. ([See changes](CHANGELOG_API.md)). - Fixed #907 // Internal "driver decode()" method will now throw an if the string data looks corrupted. - Internal: Implemented multiple keys fetch (*if supported by the backend*) to improve the performances behind all `getItems()` calls. Currently only supported in some backends, but it may evolve in the future. - __Misc__ - Fixed multiple code typo & updated README.md
Can you test the 9.2 dev branch |
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. |
What type of feature would you like?
New backend support
The feature request
The current set function
new RedisConfig())->setRedisClient($redisClient)
only accept Redis objectI'd like to request support
RedisCluster
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
The text was updated successfully, but these errors were encountered: