Skip to content

Handle Response object from runner in frankenphp #177

Open
@guillaume-sainthillier

Description

@guillaume-sainthillier

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']);
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions