Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Added App::process() to expose Request -> Response functionality #1688
It's currently very difficult to give the application a request and retrieve a response. To have a request that isn't created from the PHP super globals you need to patch the container.
A project of mine (PHPFastCGI) has struggled to provide a clean adapter to the Slim framework for this reason.
The are two that I can think of:
Assuming that people think this is a good idea:
Interested to hear thoughts :)
I don't see the problem you are solving with this PR. Is there something that __invoke doesn't do that you need?
$request = Request::createFromGlobals(); $response = $app($request, $response); $app->send($response);
Was the same as doing:
Then that would solve the problem.
(Edit) - But that sort of change couldn't be made until 4.x because it would break B/C
@geggleto That only works if you've patched the container or want the request to be created from global variables.
In my project the request is received from a FastCGI connection.
(edit to clarify: That's not PHP-FPM, the application runs as its own FastCGI daemon)