Eclipse Indigo with PHP PDT & Aptana Studio 3 for Drupal development

I've been using Eclipse for a while now and during that time have slowly compiled a large amount of Drupal related snippets and templates. Unfortunately, one day my computer crashed and all my lovely snippets just disappeared. After locking myself in a dark room and crying for a little while, I thought this would be a good opportunity to upgrade from Eclipse Helios to Indigo. Below are the steps I followed to achieve this using Windows 7.

Install Eclipse Indigo

  • In your browser, go to http://www.eclipse.org/downloads/ and download Eclipse Classic.
  • After downloading, extract the Eclipse folder and place it in your Program Files directory, or somewhere else.
  • Start Eclipse and choose your Workspace, I just used the default location in my user folder.

Install PHP PDT

  • In the Eclipse menu at the top, click Help > Install New Software.
  • In the Install window, click the drop down arrow on the Work With field and select Indigo - http://download.eclipse.org/releases/indigo.
  • Eclipse will give you a list of options in the main window. Look for Programming Languages and expand the tree.
  • Look for This feature provides SDK for PHP Development Tools and check the checkbox.
  • At the bottom, click Next and finish the installation.
  • When asked to restart Eclipse, do so.

Install Aptana Studio 3

  • In the Eclipse menu at the top, click Help > Install New Software.
  • In the new Install window, click the Add button and enter the following details:

    • Name: Aptana
    • Location: http://download.aptana.com/studio3/plugin/install
  • Eclipse will give you one option in the main window called Aptana Studio 3, check this.
  • Click Next at the bottom and finish the installation.
  • When asked to restart Eclipse, do so.

Install GIT (EGIT)

Drupal uses GIT for version control, so we need to install the Eclipse EGIT plugin from http://www.eclipse.org/egit/download/, that is if you don't want to use one that comes with Aptana.

  • In the Eclipse menu at the top, click Help > Install New Software.
  • In the Install window, click the drop down arrow on the Work With field and select Indigo - http://download.eclipse.org/releases/indigo.
  • Eclipse will give you a list of options in the main window. Look for Collaboration and expand the tree.
  • Look for ECLIPSE EGIT and check the checkbox.
  • Click Next at the bottom and finish the installation.
  • When asked to restart Eclipse, do so.

If your working locally, it might be worth telling GIT to ignore Eclipse files in the .gitignore file that ships with Drupal:

# Eclipse
.project
.settings

Install Drupal Eclipse Plugin

  • In the Eclipse menu at the top, click Help > Install New Software.
  • In the new Install window, click the Add button and enter the following details:

    • Name: Drupal
    • Location: http://xtnd.us/downloads/eclipse
  • Eclipse will give you one option in the main window called Drupal for Eclipse, check this.
  • Click Next at the bottom and finish the installation.
  • If asked to restart Eclipse, do so.

Import Drupal Templates

This is if you are using the Eclipse PHP editor. If you are wanting to use the Aptana PHP editor, skip this and read Import Drupal Ruble for Aptana Studio 3.

  • In your browser, go to http://drupal.org/project/eclipse.
  • Download the tar.gz file according to your version preference.
  • Extract and remember the location of the Drupal.xml file.
  • In the Eclipse menu at the top, click Window > Preferences.
  • In the Preferences window, on the left menu, look for and expand PHP > Editor > Templates.
  • On the right, click the Import button and locate the Drupal.xml file.
  • Click OK to close the Preferences window.

Import Drupal Ruble for Aptana Studio 3

Note this is for Drupal 7. If using the Aptana PHP editor, you need this to have Drupal code suggestions as PHP templates (above) don't work.

  • In your browser, go to https://github.com/HollyIT/Drupal-Bundle-for-Aptana and download the ruble (the zip button near the top left).
  • Extract the files and rename the folder to drupal.ruble then move it to your Aptana Rubles folder. This is usually located at C:\Users\[username]\Aptana Rubles in Windows 7.
  • Restart for good luck.

Configuring Eclipse for Drupal

Optional Plugins:

Wordwrap

Eclipse does not wrap lines of text which I find annoying. Luckily there is a plugin available at http://ahtik.com/blog/projects/eclipse-word-wrap/ where you can toggle between enabling or disabling word wrap.

  • In the Eclipse menu at the top, click Help > Install New Software.
  • In the new Install window, click the Add button and enter the following details:

    • Name: Word Wrap
    • Location: http://ahtik.com/eclipse-update/
  • Eclipse will give you one option in the main window called Word Wrap, check this.
  • Click Next at the bottom and finish the installation.
  • If asked to restart Eclipse, do so.

Eclipse Color Theme

I find the Eclipse color syntax highlighting options fairly limited. Luckily there is a plugin available at https://github.com/eclipse-color-theme/eclipse-color-theme#readme where you can easily toggle between Eclipse color themes.

  • In the Eclipse menu at the top, click Help > Install New Software.
  • In the new Install window, click the Add button and enter the following details:

    • Name: Color Theme
    • Location: http://eclipse-color-theme.github.com/update
  • Eclipse will give you one option in the main window called Eclipse Color Theme, check this.
  • Click Next at the bottom and finish the installation.
  • If asked to restart Eclipse, do so.
  • To toggle themes, in the Eclipse menu at the top, click Window > Preferences.
  • In the Preferences window, on the left menu, look for and expand General > Appearance > Color Theme.
  • Choose the theme you want, click Apply.

If you're not happy with the themes available, you can download more at http://www.eclipsecolorthemes.org/?q=.

Remote System Explorer

This plugin is great for viewing remote files but also lets you work on and edit remote files directly.

  • In the Eclipse menu at the top, click Help > Install New Software.
  • In the Install window, click the drop down arrow on the Work With field and select Indigo - http://download.eclipse.org/releases/indigo.
  • Eclipse will give you a list of options in the main window. Look for General Purpose Tools and expand the tree.
  • Look for Remote System Explorer End-User Runtime and Remote System Explorer User Actions and check both the checkboxes.
  • At the bottom, click Next and finish the installation.
  • When asked to restart Eclipse, do so.

More information about using Remote System Explorer here.

Big brain opinions very welcome

If there are any big brains reading this and spot mistakes, or can offer better solutions/advice, please leave a comment. Note, my brain is embarrasingly tiny and one day hopes to be big, so I would ask you to be gentle, unless you really want to make a grown person cry.

Smaller brains are also OK

If there are any small brains out there reading this, please feel free to leave stupid (topic related) comments. Remember, it's OK to ask stupid questions because it makes my brain feel less stupid.