The front-interop project defines a set of interoperable interfaces for the FrontController pattern in PHP to encapsulate the request-receiving and response-sending behaviors at the outermost boundary of your HTTP presentation layer:

  • RequestHandler::handleRequest() : ResponseHandler encapsulates the logic to transform an incoming HTTP request to an outgoing HTTP response.

  • ResponseHandler::handleResponse() : void encapsulates the logic to send or emit an outgoing response.

These interfaces are completely independent of any particular request/response library. That is, they will work with PSR-7, Symfony HttpFoundation, Sapien, or any other request/response library.

Read more about the project here.

Are you stuck with a legacy PHP application? You should buy my book because it gives you a step-by-step guide to improving you codebase, all while keeping it running the whole time.