feat: FrankenPHP runtime, per-provider health probes, and ContributionAggregator #2
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Kernel;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
require_once dirname(__DIR__).'/vendor/autoload.php';
|
||||
|
||||
$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'prod', (bool) ($_SERVER['APP_DEBUG'] ?? false));
|
||||
$kernel->boot();
|
||||
|
||||
$handler = static function () use ($kernel): void {
|
||||
$request = Request::createFromGlobals();
|
||||
$response = $kernel->handle($request);
|
||||
$response->send();
|
||||
$kernel->terminate($request, $response);
|
||||
};
|
||||
|
||||
$maxRequests = (int) ($_SERVER['MAX_REQUESTS'] ?? 0);
|
||||
$requestCount = 0;
|
||||
|
||||
while (\frankenphp_handle_request($handler)) {
|
||||
if ($maxRequests > 0 && ++$requestCount >= $maxRequests) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$kernel->shutdown();
|
||||
Reference in New Issue
Block a user