PHP-Specific Command Line Tools
With PhpStorm, you can use PHP from the command line through integration with PHP-specific command line tools. Integration with command line tools is provided at the PhpStorm level, so once configured, a tool can be used in all your PhpStorm projects. Just activate or de-activate it when necessary depending on the needs of each specific project.
PhpStorm supports integration with third-party PHP-specific tools:
- Symfony, version 1.1 or higher.
-
Symfony2 that incorporates the Twig template engine.
PhpStorm 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.
- Yii.
Alternatively, you can create your own tool and populate it with commands that fit your preferences and needs. The available tools are listed in the Command Line Tool Support page of the Settings dialog box.
Note that PHP-specific command line tools work only with local PHP interpreters, see Configuring Local PHP Interpreters and Enabling PHP Support.
To work with a PHP command line tool, perform these general steps:
- Download and enable the required third party tool or define a custom tool.
- Create and open a Symfony or a Yii project, open it in PhpStorm, and monitor its structure in the Framework tool window.
- Customize the tool commands, if necessary, and have the tool definition file validated.
-
Reload the commands from the executable file.
This functionality is currently available for the Symfony tool only. You can add new tasks to the command definition file and enable PhpStorm to use them without re-configuring the command line tool, that is, without removing it from the list of available ones and adding it anew.
- Invoke commands and analyze the results of their execution in the dedicated Command Line Tools Console tool window.