Drupal Development using PhpStorm
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.
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.
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
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.
Develop with pleasure!
– JetBrains PhpStorm Team
Subscribe to Blog updates
Thanks, we've got you!
Qodana Clone Finder: Early Access Program
In December 2020, we announced the EAP for Qodana, which is rapidly evolving into a comprehensive platform that allows companies to perform multi-level evaluations of the quality of code they own, contract, or purchase. Qodana helps you detect bugs without relying on an IDE, either on a local machi…
PhpStorm 2020.2 EAP #3
The Early Access Program for PhpStorm 2020.2 is in full swing and today we’ve got the third build of the 2020.2 EAP for you. In this blog post, you can read about improvements for Git installed in WSL2 and Search Everywhere. Download PhpStorm 2020.2 EAP (more…)…
PhpStorm 2019.3.3 Preview
We’ve just rolled out a preview for the third minor update for PhpStorm 2019.3. Please give the PhpStorm 2019.3.3 Preview build 193.6494.5 a try and share your feedback with us. (more…)…
How to Upgrade to PHP 7.4 with PhpStorm
Check out our fresh video with a few nice tips and tricks on how to update your codebase to PHP 7.4. It combines materials from the PhpStorm 2019.2 and PhpStorm 2019.3 releases, with a few cool bonuses to boot. Nikita drew our attention to the fact that setters are slower than assigning prop…