1778 1454 1315 1502 1405 1899 1080 1713 1918 1826 1986 1868 1742 1453 1202 1075 1788 1981 1992 1346 1548 1517 1587 1633 1461 1795 1166 1345 1764 1073 1421 1383 1451 1557 1140 1517 1008 1307 1055 1324 1686 1040 1721 1731 1081 1059 1429 1415 1997 1366 1073 1886 1814 1495 1426 1083 1157 1167 1630 1391 1241 1303 1124 1875 1482 1166 1353 1493 1787 1830 1027 1140 1686 1364 1345 1376 1936 1517 1358 1029 1218 1634 1012 1859 1909 1179 1378 1522 1819 1474 1373 1496 1224 1167 1842 1040 1259 1348 1412 On PSR-7 middlewares | PHPnews.io

PHPnews.io

On PSR-7 middlewares

Written by Hannes Van De Vreken / Original link on May. 31, 2016

PSR-7 got released May 4, 2015. There is a discussion about middlewares based on PSR-7 messages, and it is awfully overdue. The most common middlewares in use since June 2015 are callables with this interface:

They just work. I’ve been using them since June 2015. You can stack a number of middlewares with tools like relay/relay or mindplay/middleman. I prefer the latter because it plays well with container-interop containers to resolve middlewares when you need them.

Granted, you can use them wrong by fiddling with the Response before passing it on to the next middleware. Just don’t do that. But I’d rather educate newbies than to remodel the whole thing and to make it overly complex. I’ve been giving this PSR-7 talk for 12! months now. Please just spread the word and stop discussing something that has been in use for over a year now.

Thanks.

PSR-7 middlewares discussion links:

Some links might be missing here. Feel free to send a PR.

psr-7 calevans calevans hannesvdvreken

« Diverse protections for a diverse ecosystem: Android Security 2016 Year in Review - Airbnb tricks »