The PHP command line tools that are available from IntelliJ IDEA are listed in the Command Line Tool Support page of the Settings dialog box. Integration with command line tools is provided at the IntelliJ IDEA level, so once configured, a tool can be used in all your IntelliJ IDEA projects. Just activate or de-activate it when necessary depending on the needs of each specific project.
You can download and activate an existing third-party tool or create your own tool. You can update the command definitions of third-party or a custom tool right in the IntelliJ IDEA editor.
In this section:
- Enabling integration with a third party PHP command line tool
- Creating a custom PHP command line tool
Integration with command line tools is supported via the Command Line Tool Support plugin. The plugin is not bundled with IntelliJ IDEA, but it can be installed from the JetBrains plugin repository as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
-
Download and install the desired tool. Currently IntelliJ IDEA supports integration with the following tools:
-
Symfony
version 1.1 or higher.
-
Zend Framework 1, see http://framework.zend.com/download/overview
.
-
Zend Framework 2 (ZFTool, see http://framework.zend.com/downloads/latest
.
-
Composer Dependency Manager
.
-
Drush
, version 5.8 and higher.
-
Symfony console-based tools Laravel
and Doctrine
.
These tools are installed through Composer.
-
Symfony
- Open the IntelliJ IDEA settings and click Command Line Tool Support.
- In the Command Line Tool Support page, click the Add button. In the Choose Tool to Add dialog box that opens, choose Zend Framework or Symfony.
-
In the dialog box that opens, specify the path to the definition file of the chosen tool in the Path to <tool> text box.
Depending on the chosen tool, specify the location of the following file:
-
<Zend-Framework-home>/zf.batfor Zend Framework 1. -
<Zend-Framework-home>/zf.phpor<Zend-Framework-home>/zf.phpfor Zend Framework 2. -
<Symfony-home>/data/bin/symfonyfor Symfony 1.*. -
<Symfony-home>/app/consolefor Symfony 2. -
<Composer-home>/composer.pharfor Composer -
C:/ProgramData/Drush/drush.baton Windows and/usr/bin/drushon Mac OS or Linux for Drush. -
For Laravel, the path to the artisan bundled with the tool, for example,
C:\MY_PROJECTS\PHP_PROJECTS\MyLaravelProject\artisan. - For Doctrine, the path to the tool home.
-
- In the Alias text box, specify the alias to use in calls of tool commands. Accept the default alias or edit it, if necessary.
- To activate the detected command set, select the Enable check box.
- Customize the command set, if necessary.
-
In the Show console in area, specify where you want the Input pane for typing commands opened:
- To have the Input pane opened in a pop-up window, choose the Pop-up option.
- To have the Input pane opened as a text box at the bottom of the Command Line Tools Console tool window, choose the Tool window option.
- Open the IntelliJ IDEA settings and click the Command Line Tool Support.
- In the Command Line Tool Support page, click the Add button. In the Choose Tool to Add dialog box that opens, choose Custom Tool
-
In the Tool Settings dialog box that opens, specify the following:
- Tool name and location.
- The alias to use in command calls instead of the full path to the tool.
- Brief explanation of the tool functionality.
- When you click OK, IntelliJ IDEA brings you to the Command Line Tool Support page, where the new tool is added to the list of available tool.
-
Select the newly created tool and click the Open definition in editor button. In the tool definition
.xmlfile that opens in the editor, define the tool commands. -
In the Show console in area, specify where you want the Input pane for typing commands opened:
- To have the Input pane opened in a pop-up window, choose the Pop-up option.
- To have the Input pane opened as a text box at the bottom of the Command Line Tools Console tool window, choose the Tool window option.