Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Redis User Session Storage
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WP Plugins
Redis User Session Storage
Commits
2428b95d
Commit
2428b95d
authored
5 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
PHPCS
parent
f5117731
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Coding Standards & Unit-Test Framework
Pipeline
#1160
canceled with stages
Stage:
Stage:
in 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inc/class-wp-redis-user-session-storage.php
+7
-5
7 additions, 5 deletions
inc/class-wp-redis-user-session-storage.php
with
7 additions
and
5 deletions
inc/class-wp-redis-user-session-storage.php
+
7
−
5
View file @
2428b95d
...
...
@@ -21,7 +21,7 @@ class WP_Redis_User_Session_Storage extends WP_Session_Tokens {
/**
* Holds the Redis client.
*
* @var
* @var
Redis
*/
private
$redis
;
...
...
@@ -41,9 +41,11 @@ class WP_Redis_User_Session_Storage extends WP_Session_Tokens {
/**
* Create Redis connection using the Redis PECL extension
*
* @param int $user_id User ID.
*/
public
function
__construct
(
$user_id
)
{
// General Redis settings
// General Redis settings
.
$redis
=
array
(
'host'
=>
'127.0.0.1'
,
'port'
=>
6379
,
...
...
@@ -67,14 +69,14 @@ class WP_Redis_User_Session_Storage extends WP_Session_Tokens {
$redis
[
'database'
]
=
WP_REDIS_USER_SESSION_DB
;
}
if
(
defined
(
'WP_REDIS_USER_SESSION_SERIALIZER'
)
&&
WP_REDIS_USER_SESSION_SERIALIZER
)
{
$redis
[
'serializer'
]
=
WP_REDIS_USER_SESSION_SERIALIZER
;
$redis
[
'serializer'
]
=
WP_REDIS_USER_SESSION_SERIALIZER
;
}
// Use Redis PECL library.
try
{
$this
->
redis
=
new
Redis
();
// Socket preferred, but TCP supported
// Socket preferred, but TCP supported
.
if
(
$redis
[
'socket'
]
)
{
$this
->
redis
->
connect
(
$redis
[
'socket'
]
);
}
else
{
...
...
@@ -96,7 +98,7 @@ class WP_Redis_User_Session_Storage extends WP_Session_Tokens {
$this
->
redis_connected
=
false
;
}
//
Ensure Core'
s se
ssion constructor fires
//
Pas
s
u
se
r ID to parent.
parent
::
__construct
(
$user_id
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment