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
2cc8b59b
Commit
2cc8b59b
authored
Jul 26, 2021
by
cuiweifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update : add json serializer
parent
04d22704
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
RedisUtil.php
src/Redis/RedisUtil.php
+4
-5
No files found.
src/Redis/RedisUtil.php
View file @
2cc8b59b
...
...
@@ -69,7 +69,7 @@ class RedisUtil
* @param array $options 其他参数数组,优先级高于yaconf中的相同配置
* @param string $options['serverRegion'] 服务区域,不同数据中心
* @param bool $options['master'] 哨兵模式/主从模式,默认true使用主库,若使用从库值为false
* @param string $options['serializer'] 序列化选项,包括 none|php|igbinary, msgpack自己实现msgpack_pack|msgpack_unpack, incr等方法只能使用none,set等方法使用none不能存Array或Object
* @param string $options['serializer'] 序列化选项,包括 none|php|igbinary
|json
, msgpack自己实现msgpack_pack|msgpack_unpack, incr等方法只能使用none,set等方法使用none不能存Array或Object
* @param boolean $master
* @return mixed
*/
...
...
@@ -368,10 +368,9 @@ class RedisUtil
case
'igbinary'
:
$this
->
redis
->
setOption
(
Redis
::
OPT_SERIALIZER
,
Redis
::
SERIALIZER_IGBINARY
);
// Use igBinary serialize/unserialize
break
;
case
'msgpack'
:
// Undefined class constant 'SERIALIZER_MSGPACK'
// $this->redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_MSGPACK); // Use msgpack serialize/unserialize
// break;
case
'json'
:
$this
->
redis
->
setOption
(
Redis
::
OPT_SERIALIZER
,
Redis
::
SERIALIZER_JSON
);
// Use json serialize/unserialize
break
;
default
:
$this
->
redis
->
setOption
(
Redis
::
OPT_SERIALIZER
,
Redis
::
SERIALIZER_NONE
);
// Don't serialize data
break
;
...
...
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