From 93e437efd0f8c06b437f72aa42d1fd5f5454f6f3 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 10 Nov 2018 02:57:32 +0900 Subject: [PATCH] replace swoole_http_server --- bootstrap.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap.php b/bootstrap.php index e277f1c..6a1ab99 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -6,12 +6,13 @@ use BEAR\Swoole\WebContext; use Swoole\Http\Request; use Swoole\Http\Response; +use Swoole\Http\Server; return function (string $context, string $name, string $ip, string $port) : int { if (! class_exists('swoole_http_server')) { throw new \RuntimeException('Swoole is not installed. See https://github.com/swoole/swoole-src/wiki/Installing'); } - $http = new swoole_http_server($ip, $port); + $http = new Server($ip, $port); $http->on('start', function () use ($ip, $port) { echo "Swoole http server is started at http://{$ip}:{$port}" . PHP_EOL; });