This feature is supported in the Ultimate edition only.
Before you start, install and enable the PHP and Command Line Tool Support repository plugins on the Plugins page of the Settings / Preferences Dialog.
On this page:
- Integrating an external PHP command line tool with IntelliJ IDEA
- Defining your own PHP command line tool
Integrating an external PHP command line tool with IntelliJ IDEA
-
Download and install the desired tool:
-
Symfony
, version 1.1 or higher.
-
Symfony2
that incorporates the Twig
template engine.
IntelliJ IDEA supports the official Symfony2 code style for Twig and automatically inserts one space after an opening pair of curvy braces
and before a closing pair of curvy braces in Twig templates: {{ some_variable }}. -
Zend Framework 1
.
-
Zend Framework 2 (ZFTool)
.
-
Yii
.
-
Composer Dependency Manager
.
-
Drush
, version 5.8 and higher.
-
Symfony console-based tools Laravel
and Doctrine
.
These tools are installed through Composer.
-
WordPress Command Line Interface
.
-
Symfony
-
Open the Command Line Tool Support page
( for Windows and Linux or
for macOS)
,
and click
on the toolbar.
-
In the Command Line Tools dialog that opens, choose the name of the tool from the list.
In the Visibility area, specify how you want to use the tool:
- To run the commands in the current project only, choose Project.
- To run the commands in any IntelliJ IDEA project, choose Global.
-
In the dialog box that opens, specify the path to the
.xmldescriptor 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 Enabled check box.
- Customize the command set, if necessary.
-
In the Show console in area, specify where you want to open the Input pane for typing commands:
- To open the Input pane in a pop-up window, choose the Pop-up option.
- To open the Input pane as a text box at the bottom of the Command Line Tools Console tool window, choose the Tool window option.
Defining your own PHP command line tool
-
Open the Command Line Tool Support page
( for Windows and Linux or
for macOS)
,
and click
on the toolbar.
- In the Command Line Tools dialog box that opens, select Custom tool from the Choose tool list, and specify the visibility level for it (Project or Global).
- In the Tool Settings dialog that opens, specify the path to the tool definition file,
the tool alias, and provide a brief description of the tool.
When you click OK, IntelliJ IDEA brings you to the Command Line Tool Support page, where the new tool is added to the list.
- Select the newly created tool and click
.
In the tool definition .xmlfile that opens in the editor, define the tool commands. -
In the Show console in area, specify where you want to open the Input pane for typing commands:
- To open the Input pane in a pop-up window, choose the Pop-up option.
- To open the Input pane as a text box at the bottom of the Command Line Tools Console tool window, choose the Tool window option.