Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenchuanwen
my-yaf-project
Commits
388d88d2
Commit
388d88d2
authored
Sep 05, 2018
by
testshenbd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pc
parent
ed66e352
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
+12
-16
SessionRedis.php
application/models/Redis/Db0/SessionRedis.php
+12
-16
No files found.
application/models/Redis/Db0/SessionRedis.php
100644 → 100755
View file @
388d88d2
...
@@ -10,12 +10,7 @@ class SessionRedisModel extends \Redis\Db0\AbstractModel {
...
@@ -10,12 +10,7 @@ class SessionRedisModel extends \Redis\Db0\AbstractModel {
protected
$_tableName
=
'PHPREDIS_SESSION'
;
protected
$_tableName
=
'PHPREDIS_SESSION'
;
/**
* ����key
*
* @param int $id
* @return string
*/
public
function
calcKey
(
$id
)
{
public
function
calcKey
(
$id
)
{
return
$this
->
_tableName
.
self
::
DELIMITER
.
$id
;
return
$this
->
_tableName
.
self
::
DELIMITER
.
$id
;
}
}
...
@@ -30,12 +25,8 @@ class SessionRedisModel extends \Redis\Db0\AbstractModel {
...
@@ -30,12 +25,8 @@ class SessionRedisModel extends \Redis\Db0\AbstractModel {
return
null
;
return
null
;
}
}
/**
* ��������
*
* @param int $id
* @param array $data
*/
public
function
update
(
$id
,
$data
)
{
public
function
update
(
$id
,
$data
)
{
return
$this
->
set
(
$this
->
calcKey
(
$id
),
json_encode
(
$data
));
return
$this
->
set
(
$this
->
calcKey
(
$id
),
json_encode
(
$data
));
}
}
...
@@ -64,13 +55,18 @@ class SessionRedisModel extends \Redis\Db0\AbstractModel {
...
@@ -64,13 +55,18 @@ class SessionRedisModel extends \Redis\Db0\AbstractModel {
public
function
delSessionKey
(
$key
){
public
function
delSessionKey
(
$key
){
//\Our\Log::getInstance()->write($this->calcKey($key));
//\Our\Log::getInstance()->write($this->calcKey($key));
$key
=
trim
(
$key
);
$key
=
trim
(
$key
);
return
$this
->
getRedis
()
->
del
ete
(
$this
->
calcKey
(
$key
));
return
$this
->
getRedis
()
->
del
(
$this
->
calcKey
(
$key
));
}
}
public
function
delSessionKeyTest
(
$key
){
public
function
delSessionKeyTest
(
$key
){
//\Our\Log::getInstance()->write($this->calcKey($key));
\Our\Log
::
getInstance
()
->
write
(
$this
->
calcKey
(
$key
));
$key
=
trim
(
$key
);
$redisObject
=
$this
->
getRedis
();
return
$this
->
getRedis
()
->
delete
(
$this
->
calcKey
(
$key
));
$deleteKey
=
$this
->
calcKey
(
$key
);
$res
=
$redisObject
->
del
(
$deleteKey
);
var_dump
(
$res
);
session_unset
();
session_destroy
();
exit
;
}
}
public
function
getSessionKey
(
$key
){
public
function
getSessionKey
(
$key
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment