-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] Dont use Redis connection when not required #18659
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
Conversation
nicolas-grekas
commented
Apr 28, 2016
•
edited
Loading
edited
Q | A |
---|---|
Branch? | 3.1 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | - |
License | MIT |
Doc PR | - |
if (preg_match('#[^-+_.A-Za-z0-9]#', $namespace, $match)) { | ||
throw new InvalidArgumentException(sprintf('RedisAdapter namespace contains "%s" but only characters in [-+_.A-Za-z0-9] are allowed.', $match[0])); | ||
} | ||
$this->redis = $redisConnection; | ||
$this->redis->setOption(\Redis::OPT_PREFIX, $namespace); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this breaks things if the same Redis connection is reused for several things, as you change its state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true, reverted
05b5893
to
1165459
Compare
foreach ($ids as $id) { | ||
if (false !== $value = $values[$index++]) { | ||
$result[$id] = unserialize($value); | ||
$result = array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it is for Sf 3.1 brackets were great, isn't it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nek- our policy is to not use them, to keep consistency in the codebase (and we cannot convert the whole codebase to the short array syntax, as we will need to merge 2.8 into 3.x during 3 years, and we don't want git conflicts each time we change a line dealing with an array)
Thank you @nicolas-grekas. |
…as-grekas) This PR was merged into the 3.1-dev branch. Discussion ---------- [Cache] Dont use Redis connection when not required | Q | A | ------------- | --- | Branch? | 3.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 1165459 [Cache] Dont use Redis connection when not required