Tag: psr-7
PSR-7 By Example
PSR-7 is now accepted!!!
I'm still hearing some grumbles both of "simplify!" and "not far enough!"
so I'm writing this posts to demonstrate usage of the currently published
interfaces, and to illustrate both the ease of use and the completeness and
robustness they offer.
First, though I want to clarify what PSR-7 is attempting.
On HTTP, Middleware, and PSR-7
As I've surveyed the successes and failures of ZF1 and ZF2, I've started considering how we can address usability: how do we make the framework more approachable?
One concept I've been researching a ton lately is middleware. Middleware exists in a mature form in Ruby (via Rack), Python (via WSGI), and Node (via Connect / ExpressJS); just about every language has some exemplar. Even PHP has some examples already, in StackPHP and Slim Framework.
The basic concept of middleware can be summed up in a single method signature:
function (request, response) { }
The idea is that objects, hashes, or structs representing the HTTP request and HTTP response are passed to a callable, which does something with them. You compose these in a number of ways to build an application.