-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: default values for Session Redis Handler #6614
Conversation
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.
Really great test case! One change to consider.
'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, |
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.
Should this be 0.0
?
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.
I think the regex should also be updated to check for int timeouts.
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.
Done.
{ | ||
parent::setUp(); | ||
|
||
if (! class_exists(Redis::class)) { |
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.
How about moving this to setUpBeforeClass? Or, using a class docblock instead, like @requires extension redis
?
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.
Oh, thanks. It is better.
Done.
The timeout is float.
328fa6c
to
d97d217
Compare
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.
👌
@@ -22,6 +22,8 @@ | |||
*/ | |||
class RedisHandler extends BaseHandler | |||
{ | |||
private const REDIS_DEFAULT_PORT = 6379; |
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.
private const REDIS_DEFAULT_PORT = 6379; | |
private const DEFAULT_PORT = 6379; |
What about RedisHandler::DEFAULT_PORT
?
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.
Yeah, REDIS_
is not needed.
Done.
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: