fix: Improve detection of frankenphp worker mode

Signed-off-by: Carl Schwan <carlschwan@kde.org>
This commit is contained in:
Carl Schwan 2026-06-02 16:47:02 +02:00
parent 774420a188
commit 2933ddd31d
No known key found for this signature in database
GPG key ID: 02325448204E452A

View file

@ -130,7 +130,7 @@ $handler = static function () {
}
};
if (function_exists('frankenphp_handle_request')) {
if (function_exists('frankenphp_handle_request') && isset($_SERVER['FRANKENPHP_WORKER']) && $_SERVER['FRANKENPHP_WORKER'] === '1') {
$maxRequests = (int)($_SERVER['MAX_REQUESTS'] ?? 0);
for ($nbRequests = 0; !$maxRequests || $nbRequests < $maxRequests; ++$nbRequests) {
$keepRunning = \frankenphp_handle_request($handler);