Skip to content

Commit

Permalink
[ReactPHP] Update to PHP 8(.4)
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed Aug 30, 2024
1 parent 9a84fba commit 43568dc
Show file tree
Hide file tree
Showing 3 changed files with 494 additions and 315 deletions.
9 changes: 4 additions & 5 deletions images/reactphp/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Symfony\Component\Yaml\Yaml;
use Psr\Http\Message\ServerRequestInterface;
use React\Http\Message\Response;
use React\Http\Server as HttpServer;
use React\Http\HttpServer;
use WyriHaximus\React\Http\Middleware\Header;
use WyriHaximus\React\Http\Middleware\WithHeadersMiddleware;
use const WyriHaximus\FakePHPVersion\CURRENT;
Expand All @@ -39,7 +39,7 @@
$metricsMiddleware = [];

$extraHeaders = new WithHeadersMiddleware(
new Header('Server', 'wyrihaximusnet/redirect (https://hub.docker.com/r/wyrihaximusnet/redirect)'),
new Header('Server', 'wyrihaximusnet/redirect (https://github.com/wyrihaximusnet/docker-redirect)'),
new Header('X-Powered-By', 'PHP/' . CURRENT),
);

Expand Down Expand Up @@ -175,7 +175,7 @@
echo $throwable, PHP_EOL;
});

$socket = new React\Socket\Server('0.0.0.0:7132', null, ['backlog' => 511]);
$socket = new React\Socket\SocketServer('0.0.0.0:7132', null, ['backlog' => 511]);
$socket->on('error', static function (Throwable $throwable): void {
echo $throwable, PHP_EOL;
});
Expand All @@ -186,7 +186,7 @@
echo $throwable, PHP_EOL;
});

$metricsSocket = new React\Socket\Server('0.0.0.0:7133', null, ['backlog' => 511]);
$metricsSocket = new React\Socket\SocketServer('0.0.0.0:7133', null, ['backlog' => 511]);
$metricsSocket->on('error', static function (Throwable $throwable): void {
echo $throwable, PHP_EOL;
});
Expand All @@ -199,7 +199,6 @@
$socket->close();
$metricsSocket->close();
echo 'Closed and stopped everything', PHP_EOL;
Loop::stop();
};

Loop::addSignal(SIGINT, $signalHandler);
Expand Down
2 changes: 1 addition & 1 deletion images/reactphp/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"php": "^7.4",
"php": "^8.4",
"react/http": "^1.4",
"symfony/yaml": "^5.0",
"wyrihaximus/fake-php-version": "^1.3",
Expand Down
Loading

0 comments on commit 43568dc

Please sign in to comment.