Working with PHP and the Eclipse IDE with CVS

Better productivity is programming goodness, does Eclipse fit the bill? Nathaniel (Nathan) S. H. Brown, a free lance web designer and programmer, gave us his opinion at the August 12, 2004 meeting of the Vancouver PHP Association.

Eclipse is an open source integrated development environment (IDE) that started life as a Java tool. It's backed by many big names, including IBM, Borland, HP, Intel and SAP. With an open architecture for plug-ins it wasn't long before developers were writing additional tools and language support. Detailed information can be found on the Eclipse website: http://www.eclipse.org. The base Eclipse IDE is free, as are many of its plug-ins.

Nathan first demonstrated installation on a MS Windows system. Eclipse requires installation of the Java runtime environment. After Java is installed, the Eclipse download is unzipped into the directory of your choice and eclipse.exe run. Versions of Eclipse exist for Macintosh OS X and Linux, as well.

With the Eclipse IDE now installed there's a bit more work left unless you're only interested in Java. PHP functionality is obtained with the TruStudio PHP plug-in, available from their website. There's a another PHP plug-in available named PHPeclipse. It hasn't been updated to Eclipse Version 3, yet.

The Eclipse environment, like any IDE, has it's own look and feel. Everything is handled in a Project, so this is the starting point. Eclipse uses the concept of perspectives to organize clusters of views. There is a Java Perspective, PHP Perspective, Debug Perspective and so on. Each perspective contains task specific windows such as editors, class browsers, consoles, directories and output windows. These perspectives are configurable and custom perspectives can be created. Views, on the Windows version at least, can be "torn off" the main workspace into floating windows and placed anywhere on the desktop. Handy if you have two monitors.

The TruStudio Eclipse PHP editor supports syntax coloring and automatic completion. It does continuous syntax checking, and will show errors like bad function names and mismatched braces with a wavy red underline. PHP4 or PHP5 syntax can be selected. It also allows bookmarks to be placed in the code making it easy to return to a particular spot. Work is underway to fully integrate the PHP perspective with the Eclipse debugger.

Eclipse has built-in support for version management systems under its Team feature and can be integrated with CVS. Nathan didn't have a live CVS server to demonstrate the functionality but did have screen shots of the feature set (available on his website).

Of the many plug-ins available for Eclipse Nathan finds the regular expression checker at http://brosinski.com/stephan/ very useful and gave a quick demo. He warned he wasn't sure who's regular expression rules (Perl, Java, etc) it used. Other plug-ins he's found useful or had recommended are listed below. When looking at a plug-in check its requirements carefully. Some plug-ins only work with specific versions of Eclipse. Plug-ins may be free, by donation, shareware, or for purchase. The latter could be desirable if you require corporate support.

After using Eclipse for almost two months Nathan concludes it's a keeper. It was quick to pick up and use, has improved his productivity, is extensible if he needs to develop a feature that isn't available, and the price is right (free). For people in multiple OS environments there's the added appeal of support for MS Windows, Linux and Macintosh OS X.

If you'd like to get in touch with Nathan Brown contact information is available on his website: www.nshb.net.

Nathan Brown's URL Reference List:

Presentation Slides & Tutorial:

Eclipse:

Directory Listing of all plug-ins available

TruStudio by Xored Software - PHP Development Environment

CSS Editor

Spell Checker – eSpell

Regular Expression Tester

JavaScript Editor

Another JavaScript Editor

Quantum Database Utility