Use PSR-7
sabberworm opened this issue · comments
Raphael Schweikert commented
PSR-7 is a new standard API to deal with HTTP. Instead of relying on globals like $_REQUEST
, $_POST
, php://input
for input and print
, echo
, die
, <?=
for output, it uses request and response objects.
This has the following benefits:
- Allows end-to-end unit tests with mock request and responses
- Allows internal redirects/internal requests (e.g. for updating the search index)
- Allows a single PHP process to serve more than one request (interfacing with tools like RoadRunner)
- Would make the rapila bootstrap more pluggable, e.g. using middleware