yiisoft / yii2-redis

Yii 2 Redis extension.
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
452 stars 183 forks source link

redis->set函数传第第三个参数为数组时,并不支持,报错executeCommand #218

Closed tanjhysj0 closed 3 years ago

tanjhysj0 commented 3 years ago

代码如下

Yii::$app->redis->set("key","value",['nx','ex'=>1]) 本来原生redis是完全可以这样执行的,就是实现setnx的同时来设置过期时间,但是在这里却招到了拒绝 message:mb_strlen() expects parameter 1 to be string,array give in common\\extension\\redis\\Connection.php:101

bizley commented 3 years ago

Shouldn't it be Yii::$app->redis->set("key","value", ['nx', 'ex', '1'])?

yii-bot commented 3 years ago

Thank you for your question. In order for this issue tracker to be effective, it should only contain bug reports and feature requests.

We advise you to use our community driven resources:

If you are confident that there is a bug in the framework, feel free to provide information on how to reproduce it. This issue will be closed for now.

This is an automated comment, triggered by adding the label question.