Developing on Pantheon with PhpStorm
Where do we host our applications? How do we deploy them? Can we have different environments like development, staging and production? A possible answer to all those questions is Pantheon. It provides hosting, database, caching, version control, different environments, workflows for moving an application through the development pipeline and more. Let’s go over the basics of working on a Drupal or WordPress site hosted on Pantheon, using PhpStorm.
If you prefer watching a quick screencast instead of reading lots of text, here you go:
Let’s assume a site has already been created on Pantheon. We can work on the site’s sources in two ways: using Git, developing locally and pushing changes to Pantheon once we want them to go live. The other way of working is using SFTP where we deploy our changes on the Pantheon servers directly, either manually or automatically. PhpStorm supports both modes, but for this blog post let’s stick with Git.
Using VCS | Checkout from Version Control | Git, we can enter our Pantheon’s Git repository details, which we can find on our site’s dashboard.
After selecting the path to clone into, PhpStorm prompts for our Pantheon password and then clones the entire site to our system. After cloning the site’s sources, PhpStorm will detect the framework we’re using and lets us enable support for Drupal or WordPress.
Once enabled, we can start working on our application’s code!
Deploying Changes to Pantheon
After modifying our source code, for example working on a Drupal or WordPress plugin, we can commit our changes back to Pantheon’s servers. Using the Ctrl+K keyboard shortcut (CMD+K on Mac OS X), PhpStorm lets us review the changes we made and add a description to the commit.
The Commit and Push command uploads our changes and displays them on the Pantheon site dashboard. Changes are now live in our development site, and we can use Pantheon’s workflows to advance it to a testing environment, staging or production.
What else is there?
This blog post only covered the basics. We can do many more things, like working with the hosted database directly, database refactoring and code completion. Drush, Drupal’s command line too, can be used to perform actions related to our application and even Pantheon-specific actions using Terminus. A complete tutorial on developing a Drupal or WordPress application using Pantheon and PhpStorm is available.
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…