<<

with Europa, Part 2: PHP development tools How to use Eclipse Europa for Web development using technology, PHP, and Ruby

Skill Level:

Michael Galpin ([email protected]) Developer eBay

11 Dec 2007

No matter what combination of technologies you prefer to work with as a , Eclipse is a single integrated development environment (IDE) that can increase your productivity. In Part 1 of this three-part "Web development with Eclipse Europa" series, you saw how the latest release of Eclipse — Europa — can be used to develop Java™ Web applications rapidly. Here Part 2, we'll see how easy it is to develop PHP applications using a different set of Eclipse plug-ins, collectively known as the PHP Development Toolkit (PDT).

Section 1. Before you start

Are you a PHP developer? If so, then what do you use as your development environment? Maybe you're a minimalist who likes to engage in vi vs. Emacs debates. Or maybe you prefer an IDE, but haven't been impressed with the commercial offerings available. Either way, you'll want to take a look at the PHP Development Toolkit for Eclipse. That's right — Eclipse. It's not just for Java developers anymore. A background in PHP programming is essential for getting the most out of this tutorial. Familiarity with the Eclipse IDE is helpful, but not necessary. For some background information about Eclipse, see Resources.

About this series

In this "Web development with Eclipse Europa" series, you'll see how no matter what

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 1 of 41 developerWorks® ibm.com/developerWorks

your language of choice is, Eclipse is the platform for Web development. Its flexible plug-in system makes it easy to create versions of Eclipse customized for Web development with Java technology, PHP, and Ruby. You'll see how different plug-ins give Eclipse unique capabilities for each language. You'll also see some of the common features that all Web developers can take advantage of. Throughout this series, we will be creating a sample baseball , which will allow us to enter in game data for baseball players and calculate statistics for those players.

About this tutorial

Eclipse has been a favorite IDE for Java developers for many years. However, Eclipse was designed to be a development platform for any language. Eclipse is written in the Java , so, naturally, Java development was an obvious starting point for it. Eclipse's plug-in architecture has led to a bounty of powerful plug-ins and has been key in the success of Eclipse. Taking these two facts together — Eclipse's strength as a development platform for any language and Eclipse's plug-in architecture — and you have the ingredients for an Eclipse-based IDE for PHP. That's exactly what has happened with the development of the PHP Development Toolkit.

This is Part 2 of a three-part tutorial series on developing Web applications with Eclipse. So far, we've seen how easy it is to develop Web applications in the Java language using the Eclipse IDE for Java EE Developers. The Java EE edition is really just a collection of plug-ins running on the Eclipse Platform. In this tutorial, we'll see how to develop PHP applications using a different set of Eclipse plug-ins, collectively known as the PHP Development Toolkit (PDT). We'll also see a reprise of some features in the Java EE Edition that are also part of the PDT.

Prerequisites

A background in Java programming is essential for getting the most out of this tutorial. Familiarity with the Eclipse IDE is helpful, but not necessary.

System requirements

You'll need the following installed on your :

Eclipse Europa This tutorial uses Eclipse V3.3 (Europa).

Java Development Kit (JDK) This tutorial shows you how to develop Web applications using Java technology, so you'll need the Java Development Kit (JDK) 5.0 or higher. Download V5.0 or V6.0.

Eclipse IDE for Java EE Developers You'll also need the Eclipse IDE for Java EE Developers.

PHP development tools Page 2 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

Java Runtime Environment (JRE) To run Eclipse, you must have a JRE.

Apache Tomcat The application uses a Apache Tomcat as its container.

MySQL V5.0 The application uses MySQL V5.0 as its .

Java Persistence API You will also need the Java Persistence API and, in particular, the OpenJPA implementation.

Eclipse PHP Development Toolkit (PDT) This tutorial shows you how to develop Web applications using PHP, so you'll need the PHP Development Toolkit You can get this as a set of plug-ins for an existing Eclipse installation. If you're new to Eclipse, you can get an all-in-one installation that includes the Eclipse platform and the PDT plug-ins.

PHP You need PHP, so get the latest version, which at the time of this writing was V5.2.1.

Apache HTTP Server You need a that integrates with PHP. This tutorial was developed using Apache V2.0.59.

Fancy PHP debugger You need a PHP debugger. We used the Debugger V5.2.10.

Operating system You need an capable of running all of the above. We used Mac OS X when creating this series, but you can use a modern version of Windows® or ®, as well. Adjust locations of files accordingly.

Section 2. Introducing the PHP Development Toolkit

The PDT hit its 1.0 release in September 2007, so what are you waiting for? Let's start using the PDT and becoming more productive PHP developers.

Why an IDE?

Of course, one of the beauties of PHP is that you can accomplish much with very simple tools. You can write code directly in a "live" directory on your Web server, point your browser to the page, and voilà! Need to change the code? Just modify it

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 3 of 41 developerWorks® ibm.com/developerWorks

with a and refresh your browser. Who needs an IDE?

Applications can start out simple, but inevitably become more complex. The second law of thermodynamics (entropy increases over time) applies as much to engineering as it does to Maxwell's demon (see Resources if you find these metaphors are a bit obscure). For most developers, it is much easier to develop such systems if they have a debugger to stop the of code, step through the code, examine the state of the application, etc.

Complex applications usually involve multiple developers working on them. Source control usually comes into play, and it's nice to have that integrated into your development environment. Using source control often involves keeping your source and execution environments (Web server, typically) separate. In that case, it's nice to have a development environment that makes it easy to deploy code to your Web server for you.

PHP development almost always involves working with a database, as well. Of course, you can use command-line and text-based tools for working with a database. Or you can use a graphical program to make this easy. It's nice if your graphical environment is integrated in to your development environment. There's that term: Integrated Development Environment. The PDT is definitely just that.

Why PDT?

Let's assume you're convinced an IDE offers advantages for PHP development. The PDT is not the first or only IDE for PHP. There are some highly regarded commercial IDEs for PHP. Eclipse PDT is of charge and is open source. It's built on Eclipse, which means that you get all of the advantages of the Eclipse Platform. It is cross-platform, so you can use it on Windows, Mac OS X, or the Linux distribution of your choice. There's a huge ecosystem of plug-ins for Eclipse and, thus, for PDT, so you can add on specialized functionality as needed, as well as develop in other languages as needed. Let's take a look at just what you get with the PDT.

What do you get?

We've said that the PDT is simply a collection of plug-ins for the Eclipse Platform. Each plug-in provides specific functionality designed to enhance your productivity. The core PHP plug-ins provide , syntax hints, and integrated look-up of all PHP core functions. It integrates with your Web server and lets you easily deploy your code to the Web server. You can view the page in an internal Web browser or you can designate an external browser (Firefox, Explorer, Safari, etc.) for viewing your pages.

As mentioned, one of the most valuable things you get is an integrated debugger. You can execute your PHP code directly from the PDT (it includes a PHP executable) and also debug directly that way. You can also configure your Web server to use a debug-enabled version of PHP and debug scripts running live on your Web server.

PHP development tools Page 4 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

Last but certainly not least, you get non-PHP specific features, thanks to the extensibility of Eclipse. This includes database tools for connecting to any database (any that has a JDBC driver available, which is pretty much all ,) creating tables, querying and updating data, etc. There's also a built-in CVS in the PDT. If you use Subversion instead of CVS, you can easily get a Subversion plug-in to use, instead. Similarly, there's pretty good chance you write JavaScript and CSS along with PHP; and with PDT, you get a choice of several excellent Eclipse plug-ins for JavaScript and for CSS you can use. Now that you're surely sold on using the PDT for your next PHP project, let's take a look at installing the PDT.

Section 3. Installing the PDT

Getting and setting up the PDT is pretty painless. It's not just built on Eclipse. Like Eclipse, it's completely open source. There are no trial periods or licenses to worry about. Just download it and go. There are two ways to download it, depending if you already have Eclipse. If you completed Part 1 of this series, you already have the Eclipse Java EE Edition. We'll first look at installing the PDT on top of Eclipse.

Install as a plug-in

We'll start by installing PDT as a plug-in to Eclipse. Eclipse's plug-in architecture makes this easy. The easiest way to install any Eclipse plug-in is to use its update system. Kick that off by selecting Help > Software Updates > Find and Install, as shown below.

Figure 1. Find and install updates

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 5 of 41 developerWorks® ibm.com/developerWorks

Now you want to select Search for new features to install, as shown below.

Figure 2. Search for new features to install

PHP development tools Page 6 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

Now we need to add the PDT's update site to the list of sites that Eclipse knows about. Do that by clicking New Remote Site.

Figure 3. New remote update site

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 7 of 41 developerWorks® ibm.com/developerWorks

Now we need to enter the PDT update site's info. For the name of the new remote site, you can pick whatever you want to help you identify the site ("PHP Development Toolkit Updates," for example). The URL is the important field to enter, and the official site is http://download.eclipse.org/tools/pdt/updates, as shown below.

Figure 4. PHP update site information

PHP development tools Page 8 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

The new update site should appear in the list of sites and should be selected automatically. Make sure it's the only one selected and click Finish.

Figure 5. Select PHP update site

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 9 of 41 developerWorks® ibm.com/developerWorks

Eclipse will now ping the update site for a list of updates available to download and install. Select PHP Development Toolkit Updates and click Finish.

Figure 6. Available updates

PHP development tools Page 10 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

Now you should see the list of features to install and the license agreement. Accept the terms and click Finish.

Figure 7. Features and license agreement

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 11 of 41 developerWorks® ibm.com/developerWorks

Now Eclipse will download and install the PDT plug-ins. When it's done, it may ask you to restart Eclipse. After that, you should be able to verify the PDT installation by switching to the PHP Perspective. Select Window > Open Perspective > Other.

Figure 8. Changing perspective

PHP development tools Page 12 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

This should bring up a list of available perspectives. Select PHP from the list and click OK.

Figure 9. Select PHP perspective

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 13 of 41 developerWorks® ibm.com/developerWorks

This should open the PHP perspective. We'll be using that soon, but let's take a quick look at an alternate way to install the PDT.

Install stand-alone

If you're new to Eclipse, there's an even simpler way to install the PDT. You can download an all-in-one distribution of Eclipse and the PDT. Select and download the PDT All-In-One, then unzip it and launch Eclipse. Once you've launched Eclipse, switch to the PHP perspective by selecting Window > Open Perspective > PHP.

Figure 10. Open PHP perspective

PHP development tools Page 14 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

Now we should have PDT installed and ready to use. We need to configure Eclipse PDT.

Section 4. Configuring the PDT

With the PDT installed, we could start hacking away. There are a couple of more things we should do first, though. There are a couple of PDT configurations that will make our development easier. We'll start by configuring our Web server.

Configuring PDT with Apache

We could set up our project and use a directory under our Web server's root as a source folder, but it's better to separate our source and deployment. We need to let the PDT know where our Web server is so it can publish our source to it. To do this, open your preferences.

Figure 11. Eclipse preferences

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 15 of 41 developerWorks® ibm.com/developerWorks

Under Preferences, expand PHP and select PHP Servers.

Figure 12. PHP servers

There's usually a default server already there that hasn't really been configured. You could add a new one or just configure the default. Either way, you should see a dialog similar to Figure 13.

PHP development tools Page 16 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

Figure 13. Configure path to Web server

The important thing here is to set the path to your Web server and the URL that will correspond to it. Once you have done that, click OK. From the Preferences > PHP menu, select PHP executables.

Figure 14. PHP executables preference

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 17 of 41 developerWorks® ibm.com/developerWorks

Clicking Add should bring up the dialog shown below.

Figure 15. Add PHP executable

You can put whatever label you like. The more important thing is to select the directory where your PHP executable lives. You can use the Browse button to find this if you don't know it off the top of your head. Leave the PHP debugger set to the default Zend. Click OK, and you're done configuring your Web server. We're almost done configuring PDT. All we need to do is configure PDT to talk to our database.

Connecting to MySQL

PHP development tools Page 18 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

Our application is going to use a database and, in particular, MySQL. The PDT is a collection of plug-ins, and several of those plug-ins provide PHP-specific functionality. It also includes several plug-ins for accessing databases. However, accessing a database is not unique to PHP, and, similarly, the Eclipse database plug-ins used by the PDT are not unique to the PDT.

If you completed Part 1 of this series, you have already used the database plug-in included with PDT. If you completed Part 1 and installed the PDT as a plug-in on top of the Java EE Edition, you've already configured PDT to connect to MySQL. If not, please take a look at Part 1 and create the baseball database described there. You should be able to switch over to the Database Development perspective (Window > Open Perspective > Other > Database Development) and use the Data Source Explorer to connect to the baseball database.

Figure 16. Connecting to the baseball database

Now that we can query our database, we're ready to start writing some more code for the baseball application we started in Part 1.

Section 5. The baseball application

Now that we've set up the PDT, let's start developing with it. We'll start by creating a PHP project in the PDT. We'll then use the PDT to create our PHP files. We'll use its

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 19 of 41 developerWorks® ibm.com/developerWorks

features to assist with writing the code, then we'll use it to publish the code so we can test it.

Using the PHP wizards

We'll start by creating a PHP project in the PDT. Make sure you are in the PHP perspective (Window > Open Perspective > PHP.) By default, the PHP Explorer view is in the top-left corner. You can move this around if you like. In the PHP Explorer, right-click and select New > PHP Project.

Figure 17. New PHP project

This will bring up the New PHP Project wizard. It's a simple wizard, in that all you really need to do is set the name of the project and the location of the code.

Figure 18. New PHP project info

PHP development tools Page 20 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

Clicking Finish will create the PHP project. Now you can right-click in the PHP Explorer and select New > PHP File.

Figure 19. New PHP file

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 21 of 41 developerWorks® ibm.com/developerWorks

This will bring up the New PHP File Wizard. You can configure the path and the name of the file.

Figure 20. New PHP file info

PHP development tools Page 22 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

Just click Finish and the PDT will create a new PHP file with a skeleton in place, based on a template you can edit if you like. The first file we'll create is a file to define constants.

Listing 1. constants.

We've defined database connection constants. Obviously, you'll want to change these values to correspond to your environment's configuration. One of the nice things the PDT does is keep track of the structure of our project, including constants. By default, the PHP Project Outline view is in the bottom left corner. Select it, expand the Constants section, and you should see the structure shown below.

Figure 21. PHP project outline view

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 23 of 41 developerWorks® ibm.com/developerWorks

Now let's use these constants to create a database connection we can include in any script that needs to access our database. We'll create another PHP file, as shown above. We'll call this one db.php. We'll include our constants file, then we'll need to create a connection to our MySQL database. If you've written a lot of PHP, you probably know the syntax for this, but if not, PDT can help. By default, the PHP Function View is also in the bottom-left corner. Select it and look for the mysql_connect function.

Figure 22. Using the PHP function view

PHP development tools Page 24 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

Not only do you get a list of all the standard functions and classes in PHP V5 but you can access documentation on the function. Just select the function and hover over it. When you have the function you want, double-click it and it will be inserted at your cursor in the editor. As you start entering the input parameters to the function, the parameter info is displayed above to help you keep track of what you are entering.

Figure 23. Code assist with function

The mysql_connect function creates a connection to our database. Now we can write some code to check that our connection exists. Once again, code assist kicks in.

Figure 24. Code assist suggesting local variables

You can imagine how helpful this kind of code assist becomes, especially as your project and scripts become more complicated. The rest of the code for our db.php script is shown below.

Listing 2. dp.php script

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 25 of 41 developerWorks® ibm.com/developerWorks

$conn = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if (!$conn) { "Unable to connect to DB: " . mysql_error(); ; } if (!mysql_select_db(DB_NAME)) { echo "Unable to select mydbname: " . mysql_error(); exit; } ?>

We'll be able to reuse this script in many places. Let's start by creating a for entering new players into our system.

Player entry form

Let's create our basic form for entering a new player. We'll create a PHP file called new_player.php. We'll start off with just the basic HTML.

Listing 3. new_player.php: HTML form only

Player Entry Form

First Name:
Last Name:

The PDT gives you nice syntax highlighting for your HTML. We'll have the form submit to itself. So now we just need to add processing logic. We'll use our db.php script and once again make use of the PDT's PHP Function view to help us write the database logic. The finished script is shown below.

Listing 4. new_player.php: complete

sql = "insert into Players(First_Name, Last_Name) values ('$firstName','$lastName')";

PHP development tools Page 26 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

mysql_query($sql, $conn); $id = mysql_insert_id($conn); $label = " Insert successful for $fullName new ID=$id"; } ?> Player Entry Form

First Name:
Last Name:

Now we have a full form and script. It's time to test it out.

Deploying to Web server

Deploying to our Web server, Apache in this case, is easy with the PDT. In the PHP Explorer, right-click on the PHP page you want to test and select Run As > PHP .

Figure 25. Run as PHP Web page

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 27 of 41 developerWorks® ibm.com/developerWorks

This will bring up the Run PHP Web Page dialog. It lets you know where it is going to publish your code and what URL it is going to bring up. You can adjust this if you need to.

Figure 26. Run PHP Web page dialog

PHP development tools Page 28 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

By default, Eclipse will use its internal Web browser (this is the "native" browser for your particular OS, Internet Explorer on Windows, Safari on Mac OS X, etc.) to view the Web page. We'll use this setting for now. You should see the page, as shown below.

Figure 27. New player page in Eclipse

Enter a new player and click save. This should refresh the page.

Figure 28. Player added page in Eclipse

This is pretty good for quick testing. Chances are, your more complicated applications will make heavy use of CSS and JavaScript, so you'll probably want more sophisticated debugging options available when viewing your Web pages. To configure the Web browser to use, click Preferences > Web browser, as shown

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 29 of 41 developerWorks® ibm.com/developerWorks

below.

Figure 29. Select Web browser

Now if you relaunch the application, it should be brought up in the browser of your choice.

Figure 30. Page launched in Firefox

So far, we've created a simple page and deployed it. Let's continue to explore the PDT's features by building a slightly more complicated page.

PHP development tools Page 30 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

Section 6. Player management

We next create a list of all players. We'll see a few new ways the PDT can help with a task like this. Let's start by reading all the players from the database.

Displaying all players

The first thing we need to do is show all of our players from the database. We'll create a new PHP file called list_players.php. We'll include our db.php script, since we'll need to query our database. We'll want to use the PHP function mysql_fetch_assoc to fetch a row of a data into an in PHP. Let's assume we're not too familiar with this function and need more than the basic documentation you get from a hover in PDT. You need the PHP manual, but you're in luck: Right-click to access the manual, as shown below.

Figure 31. Accessing PHP Manual from PDT

By default, this will open the online manual at PHP.net. You can configure this, which is especially useful if you have a local copy of the manual on your computer.

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 31 of 41 developerWorks® ibm.com/developerWorks

The code for the basic display of players is shown below.

Listing 5. Basic display of all players

Player List

Player List
ID First Name Last Name

This shows our data, but let's say we want to add some sorting features, as well.

Sorts

Sorting can be done on the database, but we'll do it in PHP just for illustrative purposes. We'll use a sort for associative arrays.

Listing 6. Associative array sort

0) { $lowest_id = 0;

PHP development tools Page 32 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

$index=0; foreach ($array as $item) { if (isset($item[$id])) { if ($array[$lowest_id][$id]) { if ($item[$id]<$array[$lowest_id][$id]) { $lowest_id = $index; } } } $index++; } $temp_array[] = $array[$lowest_id]; $array = array_merge(array_slice($array, 0,$lowest_id), array_slice($array, $lowest_id+1)); } if ($sort_ascending) { return $temp_array; } else { return array_reverse($temp_array); } } ?>

Now we add a way to select a sort and some JavaScript for triggering this on our Web page.

Listing 7. Modified player display with sort

Player List

Player List
Sort by:
ID First Name Last Name

Now that we've created a more complicated form, we might have more complicated bugs. It's probably a good time to bring a debugger into the picture.

Section 7. Debugging

To use debugging with PHP, your Web server must be set up to provide debugging symbols and to allow a debugger to connect, get debugging information, and control execution flow. You must also have a client that can connect to the server. The PDT is just such a client. One of the debuggers it supports is the Zend Debugger. Zend is the main contributor to PHP in general and a main contributor to PDT, as well.

Installing the Zend debugger

To install the Zend Debugger for PDT, you can use Eclipse's Software Update feature. This is just like what we saw with installing PDT as an Eclipse plug-in. The only difference is the update site we want is http://downloads.zend.com/pdt.

To install the Zend Debugger on your server, there are a few steps. First, you must download it (see Resources.) Then you need to add it to your PHP extensions directory and configure your php. to enable the extension (and disable any incompatible extensions.) It comes with a script called dummy.php that provides the actual debugging info to the client. See Resources for a detailed description on configuring your server. Once both are in place, we can start debugging inside the PDT.

PHP development tools Page 34 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

Debugging for PDT

To set a breakpoint in PDT, pick a line in your code, right-click next to it, and select Toggle Breakpoints.

Figure 32. Toggle a breakpoint

To start debugging, right-click on the script in the PHP Explorer and select Debug As > PHP Web Page.

Figure 33. Debug as PHP Web page

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 35 of 41 developerWorks® ibm.com/developerWorks

You should be prompted to switch to the PHP Debugging perspective. Go ahead and do that. You should see the debugging views, as shown below.

Figure 34. The PHP debugging perspective

PHP development tools Page 36 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

You can step through your code now and inspect variables.

Figure 35. Inspecting a

If you use Eclipse for Java development, all of this will look very familiar. It's the same set of debugging facilities used in Java development. It's a powerful debugger that is sure to increase your productivity.

Section 8. Summary

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 37 of 41 developerWorks® ibm.com/developerWorks

Eclipse can be used for setting up everything you need for Web development. It integrates with databases, Web servers, and whatever else you need. It provides wizards for creating projects and PHP files. It provides syntax highlighting, code assist, graphical structure views of your code and project, lists of functions, and quick access to documentation. It can easily publish your code and run it. Finally, it brings Eclipse's powerful debugger to the world of PHP.

In Part 3, we'll use the Ruby Development Tools (RDT) and RadRails plug-ins to extend our baseball application further, taking further advantage of using Europa for Web development.

PHP development tools Page 38 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

Downloads

Description Name Size Download method Part 2 os-eclipse-europa2-baseball.zip4KB HTTP

Information about download methods

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 39 of 41 developerWorks® ibm.com/developerWorks

Resources

Learn • Start with "Web development with Eclipse Europa, Part 1: The Java EE for Eclipse" if you are new to this series. • See the entries for the second law of thermodynamics and Maxwell's demon, which was a thought experiment meant to raise questions about violating the second law of thermodynamics. • Find all about the Europa release of Eclipse in the developerWorks article "A whirlwind tour of Eclipse Europa." • Get an introduction to Eclipse and a peek at its colorful history in the developerWorks article "Get started with the Eclipse Platform." • Are you new to PHP? The best place to start is the developerWorks series "Learning PHP." • Check out all of the PHP resources on developerWorks. • Increase your PHP productivity even more by learning and using the CakePHP framework in the developerWorks five-part series "Cook up Web sites fast with CakePHP." • Learn about using DHTML and PHP together in the developerWorks article "Devise Web 2.0 applications with PHP and DHTML." • PHP integrates easily with native code, such as the search engine. See how they can be used together in "Build a custom search engine with PHP." • Documentation, articles, and downloads of Eclipse are available from the . • Interested in what's happening in the Eclipse community? Check out PlanetEclipse. • Check out the available Eclipse plug-ins at Eclipse Plug-in Central. • Check out EclipseLive for webinars featuring various Eclipse technologies. • Check out the "Recommended Eclipse reading list." • Browse all the Eclipse content on developerWorks. • New to Eclipse? Read the developerWorks article "Get started with Eclipse Platform" to learn its origin and architecture, and how to extend Eclipse with plug-ins. • Expand your Eclipse skills by checking out IBM developerWorks' Eclipse project resources. • To listen to interesting interviews and discussions for software developers, check out check out developerWorks podcasts. • For an introduction to the Eclipse platform, see "Getting started with the Eclipse

PHP development tools Page 40 of 41 © Copyright IBM Corporation 1994, 2008. All rights reserved. ibm.com/developerWorks developerWorks®

Platform." • Stay current with developerWorks' Technical events and webcasts. • Watch and learn about IBM and open source technologies and product functions with the no-cost developerWorks On demand demos. • Check out upcoming conferences, trade shows, webcasts, and other Events around the world that are of interest to IBM open source developers. • Visit the developerWorks Open source zone for extensive how-to information, tools, and project updates to help you develop with open source technologies and use them with IBM's products. Get products and technologies • Check out the latest Eclipse technology downloads at IBM alphaWorks. • Download Eclipse Platform and other projects from the Eclipse Foundation. • Download IBM product evaluation versions, and get your hands on application development tools and middleware products from DB2®, Lotus®, Rational®, Tivoli®, and WebSphere®. • Innovate your next open source development project with IBM trial software, available for download or on DVD. Discuss • The Eclipse Platform newsgroups should be your first stop to discuss questions regarding Eclipse. (Selecting this will launch your default news reader application and open eclipse.platform.) • The Eclipse newsgroups has many resources for people interested in using and extending Eclipse. • Participate in developerWorks blogs and get involved in the developerWorks community.

About the author

Michael Galpin Michael Galpin has been developing Java software professionally since 1998. He currently works for eBay. He holds a degree in mathematics from the California Institute of Technology.

PHP development tools © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 41 of 41