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

Michael Dowling:
A Case for Higher Level PHP Streams in PSR-7
July 15, 2014 @ 10:54:53

In his latest post Michael Dowling looks at a recently proposed PSR standard (the HTTP message one, created by him) and some of his thoughts around it and what it could do for the community.

There's been a lot of talk lately about the PSR HTTP message proposal, PSR-7. The purpose of the proposal is to create a shared interface that can be used by projects to interact with HTTP messages for both clients and servers. When I created the proposal, I envisioned the purpose is not to say projects that utilize HTTP messages need to make breaking changes to use the proposed interfaces, but rather give projects an interface for which they can create an adapter.

He points out that the major part of the proposal that's being debated is the message body methods and structure. He gives a quick overview of this API and how streams could fit in with it, providing a flexible abstraction layer over the actual data. He includes a few ideas for some functionality that could make streams work relatively easily with the proposal (using a StreamInterface):

  • No Auto-registering of stream protocols and filters
  • Exceptions cause warnings in stream wrappers and filters
  • Functionality is spread over many functions

He also shares an example (based around the Guzzle HTTP library) showing how this interface could be put to work. He also talks some about one of the major concerns voiced right now, getting the actual stream itself to work with, and shows how the "detach" method matches this goal.

0 comments voice your opinion now!
usecase streams highlevel psr7 proposal http

Link: http://mtdowling.com/blog/2014/07/03/a-case-for-higher-level-php-streams/

Web Mozarts:
Symfony2 Form Architecture
March 07, 2012 @ 11:13:31

In this new post to the Web Mozarts site, Bernhard talks about the architecture behind the current Symfony2 forms implementation and how it handles the requests your forms make.

Symfony2 features a brand-new Form component that, to my knowledge, supersedes most existing PHP form libraries in functionality and extensibility (not counting the still lacking, native JavaScript support). [...] The purpose of this post is to demonstrate that the Symfony2 Form component is perfectly suited for this requirement. Symfony2-specific functionality can be unplugged, leaving only the raw core dealing with form processing and abstraction.

The post is broken up into several different sections, each detailing a different aspect of this Forms functionality:

  • It's influences from other frameworks
  • Key aspects it provides
  • Abstraction (reusable code)
  • Extensibility
  • Compositionality
  • Separation of Concerns
  • Model Binding
  • Dynamic Behavior

Both a high-level architecture and low-level architecture are provided, showing you the internal flow behind the form handling. You can find out more about this component in the Symfony manual or peek into the code on github.

0 comments voice your opinion now!
symfony2 form architecture highlevel lowlevel component



Community Events





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


opinion podcast series community package library interview api symfony install update laravel framework deployment tips release language list introduction zendserver

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