在 $worker = new Worker(); 里面创建两个
$mqtt = new Workerman\Mqtt\Client()
$mqtt_to = new Workerman\Mqtt\Client()
导致错误
Warning: Cannot declare class \Workerman\Protocols\Mqtt, because the name is already in use in E:\iot_gateway\vendor\workerman\mqtt\src\Client.php
on line 185
怎么解决呢? 谢谢您
已经修复。更新workerman/mqtt 到1.1或者后续更高版本
composer require workerman/mqtt ^1.1