News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matthew Weier O'Phinney:
PSR-7 Accepted!
May 20, 2015 @ 09:55:41

As Matthew Weier O'Phinney mentions in his latest post, the PSR-7 standard (HTTP) has passed and is officially accepted as a standard by the PHP-FIG group.

The road to PSR-7 was a long and winding one. It started in summer of 2012 as a draft proposal on HTTP clients by Benjamin Eberlei, during which others proposed that perhaps a smaller standard on the HTTP message interfaces themselves - which would also allow targeting server-side applications, as those rely on the messages.

He follows the proposal's flow through the PHP-FIG process, pointing out several others who contributed along the way and what changed along the way. He also includes a section of thanks for some of the other developers and PHP-FIG members that made contributions along the way.

0 comments voice your opinion now!
psr7 phpfig accepted standard history

Link: https://mwop.net/blog/2015-05-18-psr-7-accepted.html

Phil Sturgeon:
A Quick Note on PSR Numbering
May 06, 2015 @ 09:41:55

With a lot of talk happening around the PSR-7 HTTP request/response proposal and PSR-4 being the last "official" standard to be posted, some people are wondering what happened to PSR-5 and 6. Phil Sturgeon, a previous member of the PHP-FIG, has posted some clarification to how the PSR process works and where those seemingly missing PSR numbers are at.

The last PSR from the FIG to be sent out into the world, to be used by whoever felt like using it, was PSR-4: Autoloader. Now people are starting to hear about PSR-7, and they're starting to "lolphp", wondering what has happened to PSR-5 and PSR-6. [...] This is not like The Neverending Muppet Debate of PHP 6 v PHP 7, despite it being the first though to pop into many peoples heads. Instead, this is down to the Workflow Bylaw I put into place last year.

He goes on to talk about the current workflow stages and how, unlike systems in other languages, the PHP-FIG's process gives proposals a PSR number even before they're published and accepted. He also briefly talks about PSR "nicknames", naming to differentiate between similar proposals and how, despite the need for these names, they're just reference points for conversations more than anything.

0 comments voice your opinion now!
psr7 psr proposal workflow process numbering naming phpfig

Link: https://philsturgeon.uk/php/2015/05/05/psr7-numeric-workflow/

Zend Developer Zone:
Review Day Camp 4 Developers Performant PHP - PSR-7 Video
May 01, 2015 @ 09:21:36

The Zend Developer Zone site has posted a review of a recent Day Camp 4 Developers event, specifically the PSR-7 presentation from Matthew Weier O'Phiney (PSR-7 is the proposed standard for HTTP request/response interfaces).

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. [...] 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.

The author (Gary Hockin) walks you through the content provided in the video including:

  • an overview of the proposal
  • how other languages solve the same problem
  • how PST-7 will solve these same problems

Overall Gary found the talk well-presented and full of good content, especially for those just learning about PSR-7. You can find out more about Day Camp for developers and future events on their site.

0 comments voice your opinion now!
daycamp4developers performantphp session video psr7 matthewweierophinney review

Link: http://devzone.zend.com/5173/review-day-camp-4-developers-performant-php-psr-7-video/

PHP-FIG:
PSR-7 Voting Canceled
April 02, 2015 @ 09:34:40

The voting phase for the PSR-7 proposal (HTTP messaging structure) has been cancelled due to the desire to improve and clarify the spec before approving it.

Since we put PSR-7 up for a vote, a number of issues have arisen that we feel require attention. In most cases these are clarifications that, had they been made during REVIEW, could have been merged without dropping the spec back to DRAFT. Sadly, since PSR-7 is now up for a vote, we cannot make clarifications to the spec. We cannot even make clarifications after the spec is accepted, either, except by way of annotations and errata in the meta document.

We've weighed the risk of leaving the spec as-is against canceling the vote and making the required changes directly to the spec itself. This has been an ongoing discussion since the middle of last week. I had a meeting with Mathew and Paul this morning in which we decided that it would be in the best interest of everyone for us to cancel the vote and make the changes directly.

The call was a tough one, but the discussions around the proposal have worked out a lot of the kinks, just not all of them. As is mentioned in the Google Groups post, the PSR will go back up for a vote in two weeks. PSR-7 outlines a standardized interface for working with HTTP requests and responses, providing interoperability between frameworks and tools at this basic level.

0 comments voice your opinion now!
psr7 http standard http vote cancel rework review

Link: https://groups.google.com/forum/#!msg/php-fig/42WhFKJzgrQ/9YbhKdLEOp4J

Dracony:
Replacing controllers with middleware
April 01, 2015 @ 09:53:50

Dracony has a new post to his site that suggests replacing controllers with middleware and how it relates to some of the current controller practices.

Middleware is now a very popular topic in the PHP community, here are some of my thoughts on the subject. [...] The idea behind it is "wrapping" your application logic with additional request processing logic, and then chaining as much of those wrappers as you like. So when your server receives a request, it would be first processed by your middlewares, and then after you generate a response it will also be processed by the same set.

After giving a few examples of what could be a good fit for use as middleware, he makes the suggestion to replace controllers. He talks about some of the problems that middleware brings with it and how to turn things around and write controllers as middleware (and not wrap them in it). He finishes with a mention of the work being done on PSR-7 (the HTTP Request proposal) and some thoughts on how it could fit into his middleware ideas.

0 comments voice your opinion now!
middleware controller replacement opinion psr7 http

Link: http://dracony.org/replacing-controllers-with-middleware/

Matthew Weier O'Phinney:
PSR-7 is in Voting Stage!
March 20, 2015 @ 11:19:03

As Matthew Weier O'Phinney has posted, the PSR-7 PHP-FIG proposal is in the voting stages. The PSR-7 standard defines a unified interface for working with HTTP requests and responses.

As of a short bit ago, PSR-7 (meta) - HTTP Message Interfaces - is now in the voting phase! If you are a voting member of PHP-FIG, I urge you to read the specification and meta document now, and cast your vote accordingly.

I have written previously on the need for HTTP message abstractions, and also detailed how PSR-7 works. Those posts are still valid (I've kept the latter updated with all changes!). Since the review period, my sponsors and I have been looking over feedback and comments to see if any changes were needed. Fortunately, we've not found any substantive changes were really necessary; we have, however, made a few clarifications.

He clarifies some things around:

  • why base path concerns are not represented in the ServerRequestInterface or UriInterface
  • a note that UriInterface::getPath() MUST return the string "/" if the path is empty
  • that UriInterface implementations MUST percent-encode reserved characters in paths and query strings, per RFC 3986
  • why StreamableInterface is mutable, and provided guidelines to implementors and consumers regarding how and when to use writable streams
  • the addition of several sections to the meta documentation detailing solutions to common stream-based concerns

He also gets into a bit more detail about streams, base paths and some of the overall outcomes if the PSR-7 proposal passes (which it looks like it will so far).

If you adopt PSR-7, will you need to change your code? Almost certainly. The goal of PHP-FIG is to improve interoperability between projects, and PSRs typically attempt this via codification of what member projects are already doing.
0 comments voice your opinion now!
psr7 voting stage clarification basepath stream outcome

Link: https://mwop.net/blog/2015-03-19-psr-7-ready-for-vote.html

Evert Pot:
PSR-7 is imminent, and here's my issues with it.
March 04, 2015 @ 09:26:37

Evert Pot has written up a new post today with some of his thoughts about what's wrong with the PSR-7 proposal in the PHP-FIG. PSR-7 relates to a standardized interface for HTTP request and response handling.

PSR-7 is pretty close to completion. PSR-7 is a new 'PHP standard recommendation', put out by the PHP-FIG group, of which I'm a member of. [...] PSR-7 gets a lot of things right, and is very close to nailing the abstract data model behind HTTP, better than many other implementations in many programming languages.

But it's not perfect. I've been pretty vocal about a few issues I have with the approach. Most of this has fallen on deaf ears. I accept that I might be a minority in feeling these are problems, but I feel compelled to share my issues here anyway. Perhaps as a last attempt to sollicit change, or maybe just to get it off my chest.

He breaks up his thoughts into a few different categories, each with a summary and sometimes some code to help make his point a bit more clear. He talks about immutability, how objects will be immutable and shows an example of change in how Silex would have to function to follow the standard (with before/after). He then goes on to talk about the "issue with streams" and how the current proposal could allow for changing of the incoming request into a new one with new headers...not immutable. He ends the post talking about PSR-7's stance on buffering responses and how, even if his project doesn't adopt the PSR in the strictest sense, they may still take some inspiration from it.

0 comments voice your opinion now!
psr7 issues opinion phpfig http standard request response

Link: http://evertpot.com/psr-7-issues/

PHP Town Hall:
Episode 36 PSR-7 and the World of Tomorrow
February 11, 2015 @ 12:17:34

The PHP Town Hall podcast has release the latest episode today - Episode #36: PSR-7 and the World of Tomorrow. In it hosts Phil Sturgeon and Ben Edmunds are joined by Hari KT and Matthew Weier O'Phinney to discuss the PSR-7 HTTP message proposal currently in the works by the PHP-FIG.

Now PSR chats can be a little boring when its about autoloading or tabs v bloody spaces, but this PSR could have some really big impact on the way you write PHP over the next few years. We talk a bunch about Aura and Zend and their plans around middlewares, what motivated Matthew to get involved with taking over PSR-7, what middlewares mean for PHP in general and some of the concerns that have been fixed in recent iterations of the PSR like mutability, streams, etc. There also a bit of chat about turtles, standing desks and broken ribs, while Phil slowly goes loopy on pain killers.

You can catch this latest episode in a few different ways: either through the in-page audio player, by downloading the mp3 or by watching the live recording over on YouTube. Be sure to subscribe to their feed if you enjoy the episode.

0 comments voice your opinion now!
phptownhall podcast ep36 psr7 phpfig proposal

Link: http://phptownhall.com/blog/2015/02/02/episode-36-psr-7-the-world-of-tomorrow/

Matthew Weier O'Phinney:
PSR-7 By Example
January 29, 2015 @ 09:13:20

As a part of his involvement in the PHP-FIG standards group, Matthew Weier O'Phinney has been contributing to the PSR-7 proposal. This proposal defines a standardized structure for HTTP message handling. In his latest post he gets into a bit more detail on what this means for the PHP developer and how it might be implemented.

PSR-7 is shaping up nicely. I pushed some updates earlier this week, and we tagged 0.6.0 of the http-message package last week for implementors and potential users to start coding against. 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.

He starts with a base definition of what the proposal, well, proposes around HTTP messaging, both the incoming and outgoing. He describes the basic structure of an HTTP message and what each part represents. He talks about message headers, bodies and how the current library could return that content. He then looks at requests vs responses, server-side requests and some various uses cases and more practical examples:

  • HTTP Clients
  • Middleware
  • Frameworks

With the PSR-7 standard in place, all of these different tools could have interchangeable interfaces for HTTP request/responses, easily swappable with any other implementation.

0 comments voice your opinion now!
psr7 http message request response summary tool framework middleware client

Link: https://mwop.net/blog/2015-01-26-psr-7-by-example.html

Hari KT:
Conduit The Middleware for PHP
January 22, 2015 @ 10:22:16

In his latest post Hari KT looks at Conduit, a middleware system that lets you build PHP applications out of various pieces (the middleware) according to the PSR-7 specification (for HTTP messaging).

Long back, I happened to talk with Beau Simensen about stackphp on #auraphp channel. It was hard for me to digest when I noticed it need symfony/http-kernel and its dependencies. After a few months, I started to like the middleware approach of slim framework and wanted to push it to aura. But nothing happened there. Conduit is a Middleware for PHP built by Matthew Weier O'Phinney lead of Zend framework. Conduit supports the current PSR-7 proposal. I believe like the many PSR's, PSR-7 will be a revolution in the PHP world. Conduit is really a micro framework and can grow with your project.

Hari walks you through getting the tool installed and includes an example route that just echoes "Hello conduit!"back to the user. With that in place, he shows how to add in some middlewares, chosing the Aura router and dispatcher for more complex route handling, and integrating them into a simple controller/action microframework structure.

0 comments voice your opinion now!
conduit middleware psr7 proposal mwop tutorial auraframework

Link: http://harikt.com/blog/2015/01/21/conduit-middleware-for-php/


Community Events

Don't see your event here?
Let us know!


release conference series application example php7 library symfony2 interview install language opinion podcast performance configure framework introduction community laravel api

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework