Frustration can quickly set in when you are dealing with menial and often repetitive tasks such as manual code testing and deployment, yet you strive to become a more efficient programmer by staying DRY. So why not extend that quest to other parts of the application lifecycle, streamlining and automating such tasks? In this article I'll introduce you to ten PHP development tools that will help you do exactly that, leaving you with more time to concentrate on building great websites.

1. PHPUnit

Testing is a crucial part of the application development process, yet many developers give it short shrift because the task can be enormously time-consuming, plodding and error prone. To combat these issues, automated testing tools give developers the ability to write a series of testing scripts, which can be easily executed on a whim or even according to a predefined schedule. These tools also often provide a reporting feature, which details the outcome of each test run.
PHP developers have long had a great automated testing framework at their disposal known as PHPUnit. Based on the popular code-driven approach to testing known as xUnit, PHPUnit allows developers to actually write tests using familiar PHP syntax, and then execute these tests using a simple command-line utility. You can even integrate PHPUnit into continuous integration tools such as phpUnderControl (discussed further later in this article).
If you're unfamiliar with PHPUnit, check out the previously published article titled Use PHPUnit to Implement Unit Testing in Your PHP Development, which introduces the topic of automated testing using this great open source utility.

2. Phing

As a Web development project's complexity grows, developers face a number of deployment tasks that go beyond merely transferring files from the development to production server. Avoiding transferring development-specific files such as graphic templates, dealing with server-specific file permissions and configuration parameters such as database connection usernames and passwords, and figuring out how to revert changes quickly should the deployment not go as expected are all issues repeatedly faced by developers when deploying a site.
To combat these issues, developers employ build systems, which cannot make the file-transfer process much more efficient by synchronizing only those files that have changed. Build systems are also capable of following highly customized deployment procedures, which can vary according to the environment you're targeting. If you're not currently taking advantage of such a system, check out Phing, a build system modeled after the Apache Ant project. Supported on all major platforms -- Windows included -- Phing tasks can be easily configured using a simple XML syntax, and can manipulate the server file system, integrate with CVS and Subversion, and even create PEAR packages from your custom libraries.

3. GitHub

On more than one occasion I've promoted the benefits of using version control to manage your source code. Version control brings a number of advantages to any project, including the ability to experiment with code branches, roll back unwanted changes, determine which team member most recently changed a particular file, and monitor progress through logging. Although many open source version control tools are widely used, Git is the current darling of the day and happens to be my personal tool of choice.
Part of the reason for Git's rise has to do with a third-party service called GitHub, which offers users an impressive array of repository hosting services. GitHub relieves development teams of the need to manage a server repository locally and even offers free hosting services for open source projects, with a negligible fee structure in place for commercial hosting. Having quickly surpassed 1 million hosted repositories, GitHub presents a tremendous value for developers seeking to shift otherwise costly and time-consuming administrative tasks to a capable third party.

4. FirePHP

Many developers are familiar with the popular Firefox add-on Firebug, which allows you to easily inspect and experiment with a website's HTML, CSS and JavaScript. Using FirePHP, you can also use the familiar Firebug interface to review PHP errors and other analytical data of your choosing.
If you'd like to learn more about what Firebug and FirePHP have to offer, check out the article "Firebug: Add Browser-based Debugging to Your Ajax Development".

5. XDebug

While using automated testing tools such as PHPUnit will help you catch mistakes after the code has been written, sometimes you'll need some extra assistance in determining the cause of these problems. Many PHP developers rely upon a great open source debugging tool named XDebug, which can help you to examine the status of your code by providing utilities for tracing execution, profiling code performance, reviewing object contents, and much more.
If you're unfamiliar with XDebug, check out the recently published introductory tutorial, A Sanity-Saving Debugging Solution for Your PHP Development.

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.


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