We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
已经安装程序,并且能够正常运行。 使用redis扩展,使用 pecl上,phpredis 2.2.5 下面是关于redis存储数据,扩展编写 function set($key,$value,$ttl = 0) { $value = is_array($value) ? json_encode($value) : $value; $this->handle->set($key,$value); return $value; }
function set($key,$value,$ttl = 0) { $value = is_array($value) ? json_encode($value) : $value; $this->handle->set($key,$value); return $value; }
function get($key,$use_cache = true) { $value = $this->handle->get($key); $json = json_decode($value,true); return ($json == null) ? $value : $json; }
启动程序是,一直报错 Invalid argument supplied for foreach() in /home/wwwroot/default/websocket/GatewayWorker/BusinessWorker.php on line 108
求解释,谢谢
The text was updated successfully, but these errors were encountered:
看起来是读到的数据不是个有效的数组,可能是序列化/反序列化的问题。 另外get代码不严谨,获取的数据一律反序列化,但是set时有时又不序列化。
请自行review && debug下代码吧
Sorry, something went wrong.
No branches or pull requests
已经安装程序,并且能够正常运行。
使用redis扩展,使用 pecl上,phpredis 2.2.5
下面是关于redis存储数据,扩展编写
function set($key,$value,$ttl = 0)
{
$value = is_array($value) ? json_encode($value) : $value;
$this->handle->set($key,$value);
return $value;
}
启动程序是,一直报错
Invalid argument supplied for foreach() in /home/wwwroot/default/websocket/GatewayWorker/BusinessWorker.php on line 108
求解释,谢谢
The text was updated successfully, but these errors were encountered: