Commit 2cc8b59b authored by cuiweifeng's avatar cuiweifeng

update : add json serializer

parent 04d22704
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment