[Cache] Add support for Predis, RedisArray and RedisCluster#18689
Merged
Conversation
Member
nicolas-grekas
commented
May 2, 2016
| Q | A |
|---|---|
| Branch? | 3.1 ideally |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | - |
| License | MIT |
| Doc PR | - |
0727e81 to
f58751d
Compare
Member
|
This needs some fix for |
69a7634 to
3aaa30d
Compare
Merged
8cde9cc to
b8e0d65
Compare
| $connection = $this->redis->getConnection(); | ||
| if ($connection instanceof PredisCluster) { | ||
| foreach ($connection as $c) { | ||
| $hosts[] = new \Predis\Client($c); |
Member
There was a problem hiding this comment.
This will also keep the PredisCluster itself in the array of hosts. Is it expected ?
Member
Author
There was a problem hiding this comment.
good catch, fixed
0343749 to
5ca5666
Compare
| } elseif ($redisClient instanceof \RedisArray) { | ||
| } elseif ($redisClient instanceof \RedisCluster) { | ||
| } elseif ($redisClient instanceof \Predis\Client) { | ||
| } else { |
Member
There was a problem hiding this comment.
This looks really weird. I would prefer something like this:
if (!$redisClient instanceof \Redis && !$redisClient instanceof \RedisArray && !$redisClient instanceof \RedisCluster && !$redisClient instanceof \Predis\Client) {
// ...
}5ca5666 to
f2ee0c8
Compare
| if ($pipe) { | ||
| $this->redis->exec(); | ||
| } | ||
| if (isset($e)) { |
Member
There was a problem hiding this comment.
Instead of using isset, you should declare the $e variable and check if it's not null here.
f2ee0c8 to
b004243
Compare
Member
|
Thank you @nicolas-grekas. |
fabpot
added a commit
that referenced
this pull request
May 4, 2016
…uster (nicolas-grekas) This PR was merged into the 3.1-dev branch. Discussion ---------- [Cache] Add support for Predis, RedisArray and RedisCluster | Q | A | ------------- | --- | Branch? | 3.1 ideally | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- b004243 [Cache] Add support for Predis, RedisArray and RedisCluster
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.