Having a keen interest in PSR-7 myself, I was delighted to see that Matthew Weier O’Phinney (the Supreme Allied Commander of Zend Framework) was going to be speaking on it himself at the latest Day Camp 4 Developers day.
For those who don’t know, Day Camp 4 Developers is a periodic (quarterly I think) day of online training based around a specific topic, and aims to let developers take a day away from developing in order to better themselves on a given topic. The speakers are generally regarded as an expert in that field and are experienced trainers. Generally the topics have been more “soft skills” or career focused, but the most recent have been more technically focused.
PSR-7 deals with specifying interfaces to define HTTP messages (namely request and response messages), and in this talk Matthew introduces the concepts around HTTP messaging, and the PSR-7 implementation that models them. Matthew is the current editor of the proposed PSR-7 standard so this talk was obviously going to be given straight from the horse’s mouth.
Matthew neatly starts the video with a brief introduction of himself before launching straight into the content. At this point it’s worth noting that while Cal Evans’ introduction was crystal clear, the audio quality once Matthew takes over shows a marked drop in quality. I know this is because Cal (a regular podcaster and video creator) has expensive equipment while Matthew doesn’t, but it was slightly frustrating until you get used to it after a few minutes.
Once you are immersed in the content, you forget the audio quality quickly as Matthew does an entertaining and succinct job of explaining about HTTP messages. Firstly we’re introduced to the problems that surround handling HTTP requests and responses in a modern PHP application. This takes a little explaining as obvious PHP was built for the web, but they way we use it in more current applications (particularly when using frameworks) is quite different from when it was created.
Next up, Matthew took us through how those problems have been solved, rightly or wrongly, in the past, the present and in the future. For me this is really interesting stuff as I love hearing the history of the language and why decisions were made as they were. Some of the historical changes (particularly around making the request available) look particularly strange in hindsight, so I really enjoyed this part of the story.
Matthew then investigated how other languages solve these problem. Again, as a lazy man, I love to have interesting information like this bundled up and given to me, so this was really enjoyable for me. I’m guessing that both the history part and this “other languages” part may not be as interesting to everyone else as they were to me, but personally I found it very entertaining.
Moving on to the explanation of _how_ PSR-7 will solve these problems in PHP. This was probably the information that most people tuned in to find out, so it might have been disappointing to some that it was over half way through the presentation before we got into it. This is truly interesting stuff and Matthew did a great job of explaining how PSR-7 will work, and what both the interfaces and concrete implementations of the standard look like.
On a personal note, I came into the video with some prior knowledge of how PSR-7 looks, and I was hoping that some specific questions I have would be answered (the immutability of the objects springs to mind), but these were rather glossed over in this talk. I think it’s because Matthew wanted to give a good overview rather than a detailed in-depth analysis but I was faintly disappointed not to have more discussion around there “controversial” parts of the proposal.
Overall, this was a well written talk expertly delivered (as always). While it wasn’t perfect, I think that there is enough content here to make it a must-see for anyone interested in PSR-7, middleware, or the future of PHP in general.