Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Response object from runner in frankenphp #2

Closed
guillaume-sainthillier opened this issue Nov 15, 2024 · 1 comment
Closed

Handle Response object from runner in frankenphp #2

guillaume-sainthillier opened this issue Nov 15, 2024 · 1 comment

Comments

@guillaume-sainthillier
Copy link

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

I could make a PR if needed.

@guillaume-sainthillier guillaume-sainthillier changed the title Handle Response from runner Handle Response object from runner in frankenphp Nov 15, 2024
@guillaume-sainthillier
Copy link
Author

see php-runtime/runtime#177

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant