Wiki Navigation

How to setup a symfony project in Trustudio or PHPEclipse.

How to setup a symfony project in Trustudio, eclipse based php IDE.

This section will help a developer, set up a new symfony project in Trustudio IDE that will contain auto completion of symfony specific classes and helpers, along with autocompletion of your own code and PHP core.

There are three ways to set up Trustudio so that it will have the necessary data to be able to autocomplete symfony specific code. The first example is the one most likely to be used by developers only interested in developing their own code and not also developing for symfony.

Example 1. Setting up Trustudio to use a pear installation of symfony.

1. After launching Trustudio, select File->New->Project. The "New Project" wizard should now be visible.
2. Select the PHP Project under the PHP option.
3. In the next window, give your new project a name and select where it will be located. You can either default it to be located in the workspace directory, this was chosen when you first started eclipse, or you can select an external location where you may already have a project started. Click Next.
4. On the next screen, select the Libraries tab.
5. Click the "Add External Directory..." button.
6. Navigate to the root location of your PEAR installation and click Ok. On KUbuntu linux, this is located at /usr/share/php.
7. This added your entire PEAR installation. You can pick and choose if you would rather do so. With this selection, Trustudio will now be able to autocomplete for any PEAR library, including symfony.
8. Click finish in the "New Project" wizard. Trustudio will build your project and now you will be able to develop your symfony applicatoin with autocomplete support.

Example 2. Setting up Trustudio to use a SVN installation of symfony.

1. Follow steps 1 -5 of Example 1.
2. Navigate to the location of your symfony installations lib directory and click Ok.
3. Click finish in the "New Project" wizard. Trustudio will build your project and now you will be able to develop your symfony applicatoin with autocomplete support.

Example 3. Setting up Trustudio to use symfony installation you are developing on.

1. Follow steps 1 - 4 of Example 1. This assumes that you have already set up the symfony code base as a project you are working on in Trustudio.
2. Click on the Projects tab.
3. Here you can select required projects for this new project. Select the project name that corresponds to the symfony version you are working on.

4. Click finish in the "New Project" wizard. Trustudio will build your project and now you will be able to develop your symfony applicatoin with autocomplete support.

How to setup a symfony project in PHPEclipse, eclipse based php IDE.

This section will help a developer, set up a new symfony project in PHPEclipse IDE that will contain auto completion of symfony specific classes and helpers, along with autocompletion of your own code and PHP core. **Disclaimer** I don't use PHPEclipse regularly so I may be missing something here.

Example 1. Setting up PHPEclipse to use SVN installation of symfony.

1. After launching PHPEclipse, select File->New->Project. The "New Project" wizard should now be visible.
2. Select the PHP Project under the PHP option.
3. In the next window, give your new project a name and select where it will be located. You can either default it to be located in the workspace directory, this was chosen when you first started eclipse, or you can select an external location where you may already have a project started. Click Finish.
4. Right click your new project in the navigator view and select the "Properties" menu item.
5. In the Project Properties dialog select Project References.
6. Select the symfony project. Note: You must set up the symfony download as a project for it to be available. Follow steps 1 - 3 to do this.
7. Click Ok. PHPEclipse should auto complete symfony specific classes and helpers for your project.

How to setup symfony commands in both TruStudio and PHPEclipse.

This section will show you how to add common symfony commands, like clearing the cache, as runnable items from within eclipse.

1. From the workspace of the IDE, select the Run->External Tools->External Tools menu item.
2. The External Tools dialog will display.
3. Select the "Program" tree item and select PHP under the Perspectives tab.
4. Click the "New" button under the tree selector.
5. A new configuration form shows up.
6. For the "Location" browse to or type in the location of the symfony binary. For instance, with KUbuntu linux and PEAR, the location is /usr/bin/symfony
7. Next you need to set the working directory. This will be the root of your project directory, where you would normally run these commands from the command line. You can simply select the "Browse Workspace" button and select your project.
8. You will need to define the arguments for the command you are setting up. For instance, to have a clear cache command, you could simply add "cc" to the arguments. You can explore setting variables and what not if you want. You can also have this dialog show up before you run any command and change the argument list if needed.
9. Now just hit Apply and this new configuration will be available under the external run menu options.