Recommended PHP Standards Group

Introduction

A few weeks ago, Helgi and I attended PHP|Tek 2009 in Chicago, as both representatives of echolibre and The PEAR Group.

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).

So, what’s this all about?

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.

 

Attending were

Agavi – David Zülke;

Cake – Nate Abele;

PEAR – Brett Bieber, David Coallier, Helgi Þormar Þorbjörnsson, Travis Swicegood;

PhING – Travis Swicegood;

Solar – Paul Jones;

Symfony – Stefan Koopmanschap;

Zend Framework – Matthew Weier O’Phinney;

and the always amiable (i.e., at-large community member), Cal Evans.

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.

 

Sneak Preview

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.

Namespaces

All packages should be named:

\\

Example:

1

2

3

4

5

 

Exception Naming

 

All packages must declare at package level Exception (i.e., pear2\text_diff\Exception)

All packages should use SPL Exceptions where applicable

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.

Share:

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn

Leave a comment

Your email address will not be published. Required fields are marked *

Social Media

Most Popular

Get The Latest Updates

Subscribe To Our Weekly Newsletter

No spam, notifications only about new products, updates.

Categories

On Key

Related Posts

Are Hitachi TV’s Good?

Hitachi is a well-known brand in the electronics industry, offering a wide range of products including televisions. When it comes to purchasing a TV, consumers

Are Toshiba TV’s Reliable?

Toshiba is a well-known brand in the world of electronics, and their TVs are no exception. Many consumers may be wondering if Toshiba TVs are

Are Panasonic TVs Good?

Panasonic is a well-known brand in the electronics industry, and their televisions are no exception. However, when it comes to purchasing a new TV, consumers