This post will briefly discuss the formation of a Recommended PHP Standards Group, as put forward by a meeting of PHP developers at the conference. As would be expected, a bit of controversy surrounds this proposal, but my hope would be that it would be accepted and grow within the global PHP community in the coming years.
As posted by Travis Swicegood, a group of community project representatives came together to discuss naming standards for PHP 5.3 and above. (I would like to take the opportunity to publicly thank the staff of the PHP|Tek conference for providing us with a large meeting room with little more than 2 hours notice).
With PHP 5.3 being closer to a stable release, the inclusion of namespaces and packaging within projects will take on a whole new meaning for large projects. People representing The PEAR Group (PEAR2), The Zend Framework, Cake PHP, Solar PHP, Agavi and unofficial representatives of Symfony and Phing met together and we discussed standards that could benefit each of the projects and the community in general.
Being a PEAR representative with Travis, Helgi and Brett we brought to the table the feedback and problems that we have been facing over the past year and a half with namespacing standards discussions, Matthew Weier O’Phinney from the Zend Framework brought their issues, same for Agavi, Solar, Cake and Symfony (Stefan is an unofficial representative). We brewed and stormed our issues, brought solutions and came up with a standard for namespacing and package structure.
Here are a few hints about the standards (outlined on this page) which cover things like namespace packaging structure, exceptions, abstract class naming, interface naming, and concrete class naming.
All packages should be named:
1 2 3 4 5
<?php namespace pear2\text_diff\Diff; namespace zend\controller\FrontController; namespace cake\models\DatabaseModel; ?>
All of the above mentioned projects consented to this standard as of PHP 5.3. What this means to users and developers is that the barrier for entry from one framework to another becomes greatly reduced and the interoperability of packages between projects is tremendously improved.
We like to blog about things we're passionate about. We love PHP, MySQL, CouchDB, Linux, Apache - web development standards. We also like writing about building web apps and working with web technology.
You can email us on email@example.com