Skip to content

Improve RequestFetcher to work under RoadRunner #1409

Description

@joaopbnogueira

Problem Statement

Right now RequestFetcher checks for \PHP_SAPI === 'cli', which will always be true if the application is running under RoadRunner even though all the necessary server headers with request information exist.

Right now, the workaround is to instantiate an instance of RequestIntegration with a custom RequestFetcher, but would be nice to not have to do it.

Solution Brainstorm

Possibly replace the current implementation with

    public function fetchRequest(): ?ServerRequestInterface
    {
        if (!isset($_SERVER['REQUEST_METHOD'])) {
            return null;
        }

        return ServerRequest::fromGlobals();
    }

but I'm not sure why \PHP_SAPI === 'cli' was added in the first place so this might cause other issues?

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions