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 Sep 26, 2024
1 parent 9a84fba commit 260219f
Show file tree
Hide file tree
Showing 5 changed files with 578 additions and 987 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ jobs:
needs:
- generate-image-strategy
- generate-rule-strategy
- scan-vulnerability
- build-docker-image
# - scan-vulnerability
strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 2 additions & 2 deletions images/reactphp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM wyrihaximusnet/php:8.4-nts-alpine-slim-dev AS install-dependencies
FROM wyrihaximusnet/php:8.3-nts-alpine-slim-dev AS install-dependencies

WORKDIR /opt/app
USER root
Expand All @@ -8,7 +8,7 @@ USER app
COPY ./composer.* /opt/app/
RUN composer install --ansi --no-interaction --prefer-dist --no-dev -o

FROM wyrihaximusnet/php:8.4-nts-alpine-slim
FROM wyrihaximusnet/php:8.3-nts-alpine-slim

EXPOSE 7132
EXPOSE 7133
Expand Down
14 changes: 6 additions & 8 deletions images/reactphp/app.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

use Psr\Http\Message\ResponseInterface;
use React\EventLoop\Factory;
use React\EventLoop\Loop;
use ReactInspector\Collector\Merger\CollectorMergerCollector;
use ReactInspector\EventLoop\LoopCollector;
Expand All @@ -18,10 +17,10 @@
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\FakePHPVersion\Versions;
use WyriHaximus\React\Http\Middleware\Header;
use WyriHaximus\React\Http\Middleware\WithHeadersMiddleware;
use const WyriHaximus\FakePHPVersion\CURRENT;

require 'vendor/autoload.php';

Expand All @@ -39,8 +38,8 @@
$metricsMiddleware = [];

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

$middleware[] = $extraHeaders;
Expand Down Expand Up @@ -175,7 +174,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 +185,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 +198,6 @@
$socket->close();
$metricsSocket->close();
echo 'Closed and stopped everything', PHP_EOL;
Loop::stop();
};

Loop::addSignal(SIGINT, $signalHandler);
Expand Down
25 changes: 12 additions & 13 deletions images/reactphp/composer.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
{
"require": {
"php": "^7.4",
"php": "^8.3",
"react/http": "^1.4",
"symfony/yaml": "^5.0",
"wyrihaximus/fake-php-version": "^1.3",
"wyrihaximus/react-http-middleware-with-headers": "^2.0",
"react-inspector/http-middleware-printer": "^1.0",
"react-inspector/prometheus-printer": "^1.0",
"react-inspector/http-middleware": "^1.0",
"react-inspector/event-loop": "^1.0",
"react-inspector/stream": "^1.0",
"react-inspector/memory-usage": "^1.0",
"react-inspector/metric": "^1.0",
"react-inspector/metrics": "^1.0",
"react-inspector/printer": "^1.0",
"react-inspector/collector-merger": "^1.0"
"wyrihaximus/fake-php-version": "^1.9.3",
"wyrihaximus/react-http-middleware-with-headers": "^3.0",
"react-inspector/http-middleware": "dev-update-to-promise-v3 as 1.999.999",
"react-inspector/event-loop": "^2.0",
"react-inspector/stream": "^2.0",
"react-inspector/memory-usage": "^2.0"
},
"config": {
"platform": {
"php": "8.3.13"
}
}
}
Loading

0 comments on commit 260219f

Please sign in to comment.