events.php中onMessage和onClose如何使用同个数据库操作类(只实例化一次)或全局变量呢?
$DataBaseConn=null;
$gateway_text->onWorkerStart = function($connection)
{
global $DataBaseConn;
$DataBaseConn="test";
}
下面这个打印为空
public static function onMessage($client_id, $message){
global $DataBaseConn;
echo $DataBaseConn;
}
业务是运行在BusinessWorker进程的,
老大很牛逼