Use PhpStorm External Tools

Use PhpStorm External Tools

PhpStorm is an awesome IDE.

One of the it’s features is the ability define External Tools and call them when needed.

The examples that I’m going to show in here is using the command line for calling some Symfony Framework App Console commands, but you can choose anything.

Mac Preferences Window

With PhpStorm open, go to PhpStorm > Preferences menu (mac) File > Settings (win) and in the window that popups, search and click on External Tools on the left side.

on Mac

On the bottom right (mac) top right (win), you can see some buttons, click on the plus

on Mac

A window popups with some command configuration stuff to add.

on Mac

All the items in the popup are pretty self explanatory, so we are going to try to fill some of them.

After this we can click OK, and close the preferences window.

on Mac

Now if you take a look at the Tools menu you might have something like this.

on Mac

If you click on PHP Version, the terminal window will open and show you something like this.

This is a very simple example, but you can start being very creative with these commands. For example people who use Symfony2 many times have to clear the app/console cache or other stuff, so let’s going to create some shortcut’s.

app/console clear cache on Mac

doctrine update on Mac

Get creative :)