Drupal Development using PhpStorm

Posted on by

Beginning from latest Early Access Program for PhpStorm 7, the IDE now bundles Drupal Plugin providing many Drupal-specific features for Drupal 7 and 6, some of which work for Drupal 8 as well.

Watch out the video tutorial below, or check a full text tutorial on Drupal Development using PhpStorm in our PhpStorm tutorial space.

http://www.youtube.com/watch?v=hxh4p-XJ52M



Drupal Plugin provides functionality for modules, themes as well as for core Drupal development:

Enabling Drupal Integration in an Existing PhpStorm Project, or Creating a New Drupal Module

When the project you’re working on is recognized as a Drupal Module, you will be offered the ability to enable support for Drupal automatically with a popup and event in the Event Log.

In the dialog box, you need to provide some additional information for the Drupal Installation Path and version number (currently 6 and 7 are supported). Select Set up PHP | Include paths to automatically configure include paths for the project.

A new Drupal module can be created from the Welcome screen or by selecting File | New Project. Initial files in the project will be created automatically (.module and .info files).

Development Environment Auto-Configuration

Whether you enable Drupal support in an existing PhpStorm project or create a new Drupal Module, the IDE checks if the development environment is configured properly for Drupal development. If the configuration does not meet the requirements, pop-ups with a fix suggestion will appear, as well as Event Log events. To fix these issues just click the Fix link.

Auto-configuration is provided for Include Paths, File Associations (.module, .install, .info), Drupal Coding Standards.

Drupal Hooks Support (provided in .module files only)

Completion for Hook Declaration

Any hook invocations are indexed by the IDE, and hook names become available in code completion with Ctrl+Space (Cmd-Space on Mac OS X) for creating hook implementations.





Navigation to Hook Invocations from the Gutter

Navigation to any Drupal Hook is possible from the editor gutter with the ‘navigate to hook invocation’ icon:





Quick Documentation for Hook Declaration

Quick documentation for Drupal Hook can be viewed right in the IDE with View | Quick Documentation (or just by pressing F1). Documentation is taken from .api.php files provided by core and many other modules for reference purposes.





Drupal Command Line Tool Drush Integration

Drush is a command line shell and scripting interface for Drupal. PhpStorm’s command line tool supports Drush 5.8 and higher versions.





Search in Drupal API Right from the Editor



Drupal API Documentation at https://api.drupal.org/api/drupal can be easily reached from the IDE with symbol search. Just select the symbol you are interested in, invoke the context menu in the editor, and then select Search in Drupal API.

Drupal Issue Tracker Integration

Drupal.org Issue Tracker can be integrated in PhpStorm as a Generic issue tracker providing commit message generation, tasks switching in the IDE, and more. Authorisation in the Drupal.org issue tracker is not supported, so the information we can get is limited to that available to anonymous users.

Please check our detailed tutorial on Integration with an Issue Tracking System in PhpStorm and Integrating PhpStorm and the Drupal.org Issue Queue blog post by Cameron Eagans with detailed information on Drupal.org issue tracker configuration.

Issue Tracker Integration configuration is available in Settings | Tasks | Servers.

Debugging and Profiling Drupal Applications with PhpStorm

Drupal-based projects can be debugged and profiled without any Drupal-specific configuration. Please proceed with standard PhpStorm debugging or profiling workflow.

Check a full version of tutorial on Drupal Development using PhpStorm in our PhpStorm tutorial space.

Give Drupal Plugin in latest PhpStorm 7 EAP a try and let us hear your thoughts in the issue tracker, comments below or in our forums!

Develop with pleasure!

– JetBrains PhpStorm Team