Phing – phplint task
Phing is a PHP port of Java Ant. It is a great tool to use in development. It standardizes a lot of build scripts you would have to maintain internally. Unfortunately, examples seem to be lacking. As a quick introduction to Phing, I will show how you can check all your php scripts for syntax errors.
Zend_Soap_AutoDiscover and eAccelerator
The Zend Framework ships with SOAP functionality and one especially neat class called Zend_Soap_AutoDiscover.
This class uses a comment docblock to auto-generate a WSDL at runtime. I won't go into the details how it works here, but you can check the Zend Framework documentation for an example. When using this class at work, I noticed the WSDL would not always generate correctly. After a lot of digging around, I found the cause: eAccelerator.
PHP Standards
I think PHP desperately needs a standard. I really admire Python's PEP process and especially PEP 8. This is why I am really torn on the issue of openness within the PHP Standards Working Group. Greg Beaver has been against a moderated group from the beginning. Today, he made a public appeal for action and I think everyone who is involved in PHP should listen. Whether you agree with Greg or not, get involved now. Anyone who has been involved in the PHP community should realize the lasting effect of bad decisions.
My take on the issue:
Every should have a right to vote. I have no problem if a group comes together and creates a standard for the PHP language. I realize there is a lot of noise on public lists and at the end of the day, something needs to get done. However, the entire community should be able to vote on that standard before it becomes an official part of PHP. PHP Standards Working Group: lead away, but remember at the end of the day you are working for us.
Using the PHP 5.3 __DIR__ magic constant
There is a new magic constant in PHP 5.3: __DIR__. This new constant does not actually do anything new. It replaces the use of dirname(__FILE__) that is commonly found code using prior PHP versions.
Scaling URL’s
Using non-relative URL's during early development can alleviate a lot of growing pains. This may seem counter-intuitive at first, but hear me out. We all learned long ago to stop hard-coding the domain name into the href attribute of an anchor tag. Instead, we used relative URL's such as '/index.php' to make our code much more portable. However, relative URL's become a pain point when trying to scale your website. Let's review some common scenarios that can be averted with some proper planning.
Using SPL Exceptions
Brandon Savage has a great series of posts on using exceptions in PHP. Unfortunately, he does not introduce the SPL exceptions into the discussion.
Why I am not running to Solar
Some of my thoughts on Paul M. Jones post about Solar and Zend Framework. This is less of a defense of Zend Framework and more of a commentary on Paul's framework ideas.
I favor design by contract so I can properly type-hint method parameters. A framework should be written in a way I can safely extend the crap out of. This is the exact use case of interfaces.
Universal constructors make the code harder to read. I see this as a sign that inheritance is being used way too much. Compose people, compose!
The registry pattern is not any better than a singleton. They both have global scope.
I do like that there are so many ways to inject dependencies. The MVC framework is also pretty nice.





