#native_company# #native_desc#
#native_cta#

10 Productivity-boosting Tools for Your PHP Development Page 2

By W. Jason Gilmore
on August 24, 2010

6. The PHP Extension and Application Repository

Although you may very well be as unique and special as your mother claims, chances are that the code you’re currently attempting to write has been cranked out by other developers countless times before. To help developers quickly surpass shared obstacles, PHP developers regularly contribute to the PHP Extension and Application Repository, better known as PEAR. Hosting 560 packages, which can offer turn-key solutions to problems such as caching, encryption, user authentication, and payment processing, chances are you’ll find a PEAR package that suits your “unique” needs.
To help manage your PEAR packages, you can install the PEAR package manager, which provides a command-line interface to installing, upgrading and deleting packages.

7. PHP_CodeSniffer

Like the Editor Wars, arguments over coding conventions remain bitter. Even so, the PEAR Coding Standards seem to have gained a foothold within the PHP community, offering a sane approach to conventions (which I personally employ in my own projects). However, it can be easy for you or a team member to depart from these conventions, resulting in inconsistent code.
To avoid such inconsistencies, consider installing PHP_CodeSniffer, a great PEAR package that will parse your PHP, JavaScript, and CSS files and detect violations of your predefined coding standards. Although it’s possible to define your own coding standard, PHP_CodeSniffer’s default standard is conveniently the PEAR Coding Standard, making it a breeze to adopt this standard as your own!

8. phpDocumentor

There are few tasks more frustrating than attempting to decipher poorly documented source code, even if it’s code that you personally wrote some time ago. Yet like testing, documentation remains one of those tasks that developers tend to avoid at all costs. To alleviate the pain, consider using an automated documentation framework such as phpDocumentor. Supporting a simple documentation syntax, phpDocumentor will parse your source files and generate user-friendly documentation for you!
To learn more about phpDocumentor, check out the introductory tutorial I wrote on the topic some years ago titled Documenting PHP Code with PHPDocumentor, and be sure to check out the understandably great documentation on the PHPDocumentor website.

9. PHP_Beautifier

Another hindrance to understanding the intent of source code is poor formatting. Yet in the heat of banging out reams of new scripts, it can be easy to improperly indent and organize your code. You can automate this process using the PEAR package PHP_Beautifier, which among other tasks will properly indent your code and add newlines.

10. phpUnderControl

If you’re considering embracing one or more of the aforementioned utilities, consider checking out the continuous integration tool known as phpUnderControl. Built atop CruiseControl, phpUnderControl packages several PHP tools together, including PHPUnit and phpDocumentor, to provide a unified interface for managing these features.

Conclusion

Do you have a favorite PHP-oriented productivity-enhancing utility not mentioned here? Tell us about it in the comments!

About the Author

Jason Gilmore is the founder of WJGilmore.com and the author of several popular books, including “Easy PHP Websites with the Zend Framework”, “Easy PayPal with PHP”, and “Beginning PHP and MySQL, Third Edition”.