Sunday, May 11, 2008

Eclipse Tutorial Video: Starting a PHP Project from Subversion

This video will show you how to use a subversion repository to create a PHP project in Eclipse. I'll be using the subversive plugin, but the process is essentially the same if you are using subclipse.



Before you complete the steps in the lesson on your own, you will need to install the eclipse plugins for PHP Development and a Subversion Team Provider, either Subversive or Subclipse.

The first step is to define the repository. We'll configure eclipse for the groux project at https://groux.svn.sourceforge.net/svnroot/groux. We'll switch our perspective to "SVN Repository Exploring" so we'll have the necessary panels open to start. We could also show the required views from another perspective with "Window -> Show View."

To start, we define the repository by selecting the icon with the green plus sign in the top right of the "SVN Repositories" panel. In the resulting dialog, enter the repository URL. If we had write access to the repository, we'd probably need to provide our user name and password as well, but for this demonstration we'll skip that.

When you click finish, Eclipse will validate your connection. In this case, anonymous access is OK. The first time I set this up, I needed to accept the sourceforge SSL certificate, but since I elected to trust it always, we don't see that dialog this time. You'll want "trust always" or you'll be continually interrupted by questions about the certificate.

Once we have defined the repository, we have the option to browse through it to understand its layout. To create the project, we'll switch to the "Resource" perspective. You can do this from "Open Perspective" in the "Window" menu, but we'll just take the little shortcut in the top right of the Eclipse window.

In the "Project Explorer" panel, get a context menu (right-click or control-click) and select "New -> other..." Pick "Projects from SVN from the "SVN" folder. Use the repository we just configured, and select the resource you are interested in--in this case groux. Click "Finish" to end the repository selection and begin defining the project.

We'll use the "New Project Wizard" to create the project. Under the "PHP" folder, select "PHP Project," click "Next," enter a project name, and "Finish". Eclipse will offer to take you into a PHP perspective and start building the workspace. In another lesson, we'll take a look at some of the things that are available to you in the PHP project.

And that's all there is to it.

No comments: