Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix issue with Redis Cache adapter whereby setOption was being called before connecting to Redis server #4577

Closed
wants to merge 1 commit into from

3 participants

@Tomdarkness

You can't call setOption until you've connected to Redis. Not really sure why this is the case but this is how the phpredis extension behaves.

See issue #4576

@marc-mabe

Thank you to find that out. The fix looks good but could you add a test please.

@weierophinney

Ping @Tomdarkness -- would love to have this in 2.2.1, but we need a test case; can you get one to us in the next 1-2 days, please?

@weierophinney weierophinney closed this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/4603'
Close #4603
Fixes #4576
Fixes #4577
b0da7f2
@ghost Unknown referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/4603'
Close #4603
Fixes #4576
Fixes #4577
fe9ec2b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 library/Zend/Cache/Storage/Adapter/RedisResourceManager.php
View
6 library/Zend/Cache/Storage/Adapter/RedisResourceManager.php
@@ -66,13 +66,13 @@ public function getResource($id)
$redis = new RedisResource();
+ $resource['resource'] = $redis;
+ $this->connect($resource);
+
foreach ($resource['lib_options'] as $k => $v) {
$redis->setOption($k, $v);
}
- $resource['resource'] = $redis;
- $this->connect($resource);
-
$info = $redis->info();
$resource['version'] = $info['redis_version'];
$this->resources[$id]['resource'] = $redis;
Something went wrong with that request. Please try again.