Symfony2 Command Line Tool Integration
Symfony2 comes with a command line tool, console, which allows us to execute a number of commands on the application we're building. For example, console cache:clear will clear the caches, console router:debug will display current routes for the application and so on. A cheat sheet is available for the standard commands, but other commands may be added by bundles that are installed in our application.
PhpStorm provides integration for the Symfony2 command line tool. To configure it in the development environment, open Project Settings | Command Line Tool Support and add a new command line tool by clicking the + (plus) icon.
Specify the tool type as Symfony, choose project or global visibility, and click OK to proceed.
Next, provide the path to the Symfony2 command line tool. It is typically located under app/console in the project. Click OK to proceed. Command definitions will be loaded automatically by the IDE.
Once added, we can see the Symfony2 command line tool listed and that we can use it with the alias s. Note in the screenshot that the Composer command line tool has also been added.
We can now bring up the command line tool by selecting Tools | Run Command... or pressing Ctrl+Shift+X (Cmd-Shift-X on Mac OS X).
Command completion is provided for app/console commands (conveniently shortened to just s for Symfony2). All output is shown in the PhpStorm Command Line Tools Console.
Read more about command line tools in PhpStorm.