gateway-worker 启动报错
<?php
namespace plugin\webman\gateway;
use GatewayWorker\Lib\Gateway;
class Events
{
public static function onWorkerStart($worker)
{
}
static function onConnect($client_id): void
{
Gateway::sendToClient($client_id, json_encode(['type' => 'init', 'data' => $client_id]));
}
static function onWebSocketConnect($client_id, $data): void
{
Gateway::bindUid($client_id, $data['uid']);
}
static function onMessage($client_id, $message): void
{
Gateway::sendToUid($message['uid'], $message['data']);
}
}
GatewayWorker\Register::__construct(): Implicitly marking parameter $socketName as nullable is deprecated, the explicit nullable type must be used instead in D:\webman\webman-gateway\vendor\workerman\gateway-worker\src\Register.php:57
Windows 11
PHP 8.4.3
Webman 2.1.0
webman/gateway-worker 1.0.9
php8.4刚出,gatewayWorker还没做适配。目前composer上很多库不支持php8.4,不要用php8.4版本。
以后选php版本要注意不要选刚发布不久的,一是新版本bug会比较多,二是第三方库没那么快适配。
8.2吧挺好的, 8.4 的作用就是为了过度到 9 的试验版