excuse me, what should I do if workerman is enabled through PHP frameworks such as TP or CI, but some configuration files in the framework use the $_ SERVER constant, and failure to get $_ SERVER in CLI mode will cause an error?
class Mqtt extends CI_Controller {
public function index()
{
$worker = new Worker();
$worker->onWorkerStart = function(){
$mqtt = new Workerman\Mqtt\Client("mqtt://test.mosquitto.org:1883");
$mqtt->onConnect = function($mqtt) {
$mqtt->subscribe("hello");
};
$mqtt->onMessage = function($topic, $content){
var_dump($topic, $content);
};
$mqtt->connect();
};
Worker::runAll();
}
}
=======================================================
:
the above startup is combined with the startup mode of the CI framework. How to add parameters to achieve the following effects similar to starting workerman directly
php start.php start -d
=
question 3
Communication between CI and workerman besides using queues, is there any other method that can actively call or trigger workerman response in CI (the question here is not the communication between workerman and the client)