PhpStorm 2019.2 Help

Managing Phing Build Targets

Phing functionality in PhpStorm is provided through a dedicated Phing Build tool window.

In this section:

Accessing Phing Build tool window

  1. Open a Phing build file in the editor or select it in the Project tool window, and then choose Add as Phing build file from the context menu of the selection.

  2. Choose View | Tool Windows | Phing Build from the main menu. The tool window can be accessed after you have opened it through the context menu of a Phing build file in the editor or in the Project tool window.

Examining the build targets defined in a build file

  1. Open the Phing Build tool window. The window shows all the build files as nodes.

  2. Depending on your goal, do one of the following:

    • To view the build targets defined in a specific build file, expand the corresponding node by clicking plus_expand.png next to the build filename. Note that this expanding does not affect the targets marked as hidden.

    • To fold or unfold the build targets defined in all build files, click respectively the Expand All button the Expand All button or the Collapse All button the Collapse All button on the toolbar. Note that unfolding does not affect the targets marked as hidden.

    • To navigate to the definition of a target in the source code, select the desired target and choose Jump to Source from the context menu of the selection.

Hiding targets

Among the targets defined in a build file, you may have some that are only called by other targets and are never run alone. You can suppress showing such targets in the build file tree by marking them as hidden.

Hidden targets do not become visible when you expand the node of a specific build file or click Expand All button the Expand All button.

You can mark a target as hidden both directly from the Phing Build tool window or from the Phing Settings dialog. However, the hidden status can be removed only through the Phing Settings dialog.

Depending on your goal, do one of the following:

  • To mark one or several build targets as hidden, do one of the following:

    • In the Phing Build tool window, select the targets under their build file node and choose Mark to Hide from the context menu of the selection.

    • Select the build file in which they are defined and click the Settings Preferences button properties.gif on the toolbar. Then in the Phing Settings dialog that opens, switch to the Hiding targets tab and select the Hide checkboxes next to the targets to be hidden.

  • To remove the hidden status of a target:

    1. Select the build file in which it is defined and click the Settings Preferences button the Properties button on the toolbar.

    2. In the Phing Settings dialog that opens, switch to the Hiding targets tab where the Hide checkboxes next to the names of the hidden targets are selected. Clear the Hide checkboxes next to the targets for which you want the status hidden removed.

Associating a shortcut with a Phing target

You can associate a build target with a keyboard shortcut and execute commonly-used targets with a single key-stroke. If a Phing build file is added to the project, its targets appear under the Phing Targets node in the Keymap dialog.

  1. In the Phing Build tool window, right-click the desired build target.

  2. From the context menu, choose Assign Shortcut.

  3. In the Keymap dialog that opens, configure the shortcut as described in Configuring keyboard shortcuts.

Appointing targets for execution before running or debugging

  1. Open the Phing Build tool window.

  2. Select the desired target and choose Before Run/Debug from the context menu of the selection.

  3. In the Execute Target Before Run/Debug dialog that opens, select the configurations before which you want the target executed.

Last modified: 23 August 2019

See Also

Procedures: