runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Handle Response object from runner in frankenphp

Open guillaume-sainthillier opened this issue 1 year ago • 0 comments

Hello there!

Thanks for the amazing work with Frankenphp. It would be nice if frankenphp runtime could handle a Response object in the runtime. The SymfonyRuntime does handle it : https://github.com/symfony/runtime/blob/9889783c17e8a68fa5e88c8e8a1a85e802558dba/SymfonyRuntime.php#L137

One of the use case can be:

return function (array $context) {
    if ($context['APP_MAINTENANCE'] ?? false) {
        return new Response('MAINTENANCE IN PROGRESS', Response::HTTP_SERVICE_UNAVAILABLE);
    }

    return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};

guillaume-sainthillier avatar Nov 18 '24 10:11 guillaume-sainthillier