fix: default values for Session Redis Handler - #6614
Merged
Conversation
MGatner
reviewed
Oct 1, 2022
MGatner
left a comment
Member
There was a problem hiding this comment.
Really great test case! One change to consider.
paulbalandan
reviewed
Oct 4, 2022
| 'database' => preg_match('#database=(\d+)#', $matches[3], $match) ? (int) $match[1] : null, | ||
| 'timeout' => preg_match('#timeout=(\d+\.\d+)#', $matches[3], $match) ? (float) $match[1] : null, | ||
| 'database' => preg_match('#database=(\d+)#', $matches[3], $match) ? (int) $match[1] : 0, | ||
| 'timeout' => preg_match('#timeout=(\d+\.\d+)#', $matches[3], $match) ? (float) $match[1] : 0, |
Member
There was a problem hiding this comment.
I think the regex should also be updated to check for int timeouts.
| { | ||
| parent::setUp(); | ||
|
|
||
| if (! class_exists(Redis::class)) { |
Member
There was a problem hiding this comment.
How about moving this to setUpBeforeClass? Or, using a class docblock instead, like @requires extension redis?
Member
Author
There was a problem hiding this comment.
Oh, thanks. It is better.
Done.
The timeout is float.
kenjis
force-pushed
the
fix-redis-session-php81
branch
from
October 5, 2022 02:46
328fa6c to
d97d217
Compare
| */ | ||
| class RedisHandler extends BaseHandler | ||
| { | ||
| private const REDIS_DEFAULT_PORT = 6379; |
Contributor
There was a problem hiding this comment.
Suggested change
| private const REDIS_DEFAULT_PORT = 6379; | |
| private const DEFAULT_PORT = 6379; |
What about RedisHandler::DEFAULT_PORT?
Member
Author
There was a problem hiding this comment.
Yeah, REDIS_ is not needed.
Done.
datamweb
approved these changes
Oct 5, 2022
MGatner
approved these changes
Oct 5, 2022
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.
Description
Fixes #6512
Make the same as Cache Redis config.
CodeIgniter4/app/Config/Cache.php
Lines 155 to 161 in ed0cdd0
Ref, https://github.com/phpredis/phpredis#php-session-handler
Checklist: