[11.x] Use null as default cursor value for PHP Redis#53095
Merged
taylorotwell merged 3 commits intolaravel:11.xfrom Oct 10, 2024
jayan-blutui:11.x
Merged
[11.x] Use null as default cursor value for PHP Redis#53095taylorotwell merged 3 commits intolaravel:11.xfrom jayan-blutui:11.x
null as default cursor value for PHP Redis#53095taylorotwell merged 3 commits intolaravel:11.xfrom
jayan-blutui:11.x
Conversation
Contributor
Author
|
Not sure why the Windows builds failed here at the setup PHP step 🤔 Perhaps it needs to be re-run? |
scottasmith
reviewed
Oct 10, 2024
src/Illuminate/Cache/RedisTagSet.php
Outdated
| $connection = $this->store->connection(); | ||
|
|
||
| $defaultCursorValue = match (true) { | ||
| $connection instanceof PhpRedisConnection => null, |
src/Illuminate/Cache/RedisStore.php
Outdated
| }; | ||
|
|
||
| $defaultCursorValue = match (true) { | ||
| $connection instanceof PhpRedisConnection => null, |
There was a problem hiding this comment.
This probably should also do a version check as well as checking its PhpRedisConnection. That way it doesn't break it for people who have held back on upgrading the extension
if (version_compare(phpversion('redis'), '6.1.0', '>=')) {
...
}
Contributor
Author
There was a problem hiding this comment.
That's a good idea. How about I do something like:
$defaultCursorValue = match (true) {
$connection instanceof PhpRedisConnection && version_compare(phpversion('redis'), '6.1.0', '>=') => null,
default => '0',
};There was a problem hiding this comment.
I'm not a maintainer, but for me this would work 😄
timacdonald
pushed a commit
to timacdonald/framework
that referenced
this pull request
Oct 15, 2024
* fix: PHP Redis default cursor value * remove 0 as default value * add version check for phpredis 6.1.0 or above
|
@taylorotwell @jayan-blutui @scottasmith Could this issue also be backported to Laravel 10.x ? We're still running Laravel 10.x and are running into the same issue with Redis. |
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.
Fixes #53087
Additional context: phpredis/phpredis#2562
This PR attempts to fix the current issue with the changes made in PHP Redis 6.1.0 where the default cursor value of
'0'is handled differently. With some testing, setting this tonullfixes this issue.I have attempted to only make its fix available to PHP Redis and continue to use the previous value of
'0'for PRedis. If this change isn't as per the framework's standard. Happy to make changes or totally understand if this is closed. 😄