Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
php_utils
Project
Project
Details
Activity
Releases
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
bp
php_utils
Commits
665ef140
Commit
665ef140
authored
Nov 05, 2021
by
顾文旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix redis
parent
e3df8070
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
CacheUtil.php
src/Cache/CacheUtil.php
+3
-3
No files found.
src/Cache/CacheUtil.php
View file @
665ef140
...
@@ -87,7 +87,7 @@ class CacheUtil
...
@@ -87,7 +87,7 @@ class CacheUtil
if
(
is_null
(
$value
)
||
false
===
$value
)
{
if
(
is_null
(
$value
)
||
false
===
$value
)
{
return
$default
;
return
$default
;
}
}
return
$value
;
return
json_decode
(
$value
)
;
}
}
/**
/**
...
@@ -123,9 +123,9 @@ class CacheUtil
...
@@ -123,9 +123,9 @@ class CacheUtil
$key
=
$this
->
getCacheKey
(
$prefix
,
$key
);
$key
=
$this
->
getCacheKey
(
$prefix
,
$key
);
//对数组/对象数据进行缓存处理,保证数据完整性
//对数组/对象数据进行缓存处理,保证数据完整性
if
(
is_int
(
$expire
)
&&
$expire
)
{
if
(
is_int
(
$expire
)
&&
$expire
)
{
$result
=
$this
->
handler
->
setex
(
$key
,
$expire
,
$value
);
$result
=
$this
->
handler
->
setex
(
$key
,
$expire
,
json_encode
(
$value
)
);
}
else
{
}
else
{
$result
=
$this
->
handler
->
set
(
$key
,
$value
);
$result
=
$this
->
handler
->
set
(
$key
,
json_encode
(
$value
)
);
}
}
return
$result
;
return
$result
;
}
}
...
...
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