Planet Drupal

Subscribe to Planet Drupal feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 47 min 24 sec ago

Verbosity: Migrating Drupal 8 in Europe

Sun, 28/09/2014 - 13:40

This week we're in Europe for DrupalCon Amsterdam! This is starting to feel suspiciously close to a beta so it is time to dive into Migrate again so you can start working on your new sites with real-world data. Let's begin!

What's up with migrate?

Migrate in the Drupal context means running a migration from the new Drupal 8 site and pulling data from an existing site. It replaces the old upgrade-in-place system that was used in prior versoins of Drupal. So do a fresh install of Drupal 8 and have an old Drupal 6 site on the same host. After you've logged into Drupal 8 you can connect to your Drupal 6 site.

How is Drupal 8 migrate different from Drupal 7 migrate (and migrate_d2d)?

In the older versions of Migrate the process invovled defining your field mappings and manually creating the new content types in the D7 system. This is no longer necessary.

Drupal 8 migrations will automatically create the needed content types and establish the mappings between the old and new fields by default. Therefore much less configuration is needed.

For times when it is necessary to customizae your migration you can use the included hooks or you can use the configuration schema to use the included plugins with your custom data set. The hooks go further than in D7, allowing you to alter data in the prepareRow stage without having to create a custom migration to deal with the data.

Migrate from Drupal 6? What about from Drupal 7?

Migrate frees us from the need to update each sequential version. You can leafrog versions! With Drupal 6 being close to end-of-life it is important to have a pathway for these users. For this reason, the D6 to D8 path was built first.

For Drupal 7: soon. This is now in-progress now that we are finalizing the Drupal 6 code.

Requirements
  • Drush! The UI is still in a contrib sandbox, so for now you must use Drush. The latest version - from Github.
  • Composer. It is needed to install Drush. Go into the drush folder and run "composer install". Already installed? "composer update"
  • D6 Database. Have it on the same host as the new Drupal 8 install.
  • D6 Files. Probably a good idea to be on the same host. Can be file path or http(s) address.
  • D8 Database. A new, empty database. Use the old Creating the database howto if new to this.
  • D8 Files. Check out the git repo... unless of course a beta becomes available. Then use that.
Using Drupal Tools

If you do not currently have a Drupal 8 install one route to get there is to use the Drupal Tools for your platform. It includes all the software you need and the correct versions. It is available for Linux, Mac, and Windows.

If you install the Drupal Tools package it is not necessary to install Git, Drush, or Composer.

The installation should be current as it includes a version of Drush which must be up-to-date. So if you had installed Tools before, double check the version if you have any trouble.

Install Drupal8

Using the database credentials you created, install your new Drupal 8 site.

If you need to rebuild your site remember to delete your ENTIRE files folder and old settings.php. Reinstalling without doing this step will cause problems.

Install Composer / Drush

Make sure you have run the Composer installer. You should be able to type which composer and get a result in your terminal.

Check out the latest Drush. Go into the Drush folder and run composer install.

Next time you git pull (or git fetch) in the Drush folder, make sure to run composer update.

Find an isuse to test
  • Go to the Drupal project issue queue and filter down by Component: migration system, Version: 8.x.
  • Pick an issue that is not already fixed.
  • If you are sprinting with lots of people, pick something further down the list so you are not working on the same thing as someone else.
  • Read the posts. If it is easy enough you think you can handle it, post a comment to say you are doing some work on it.
  • Post the results of your tests.
Time to Migrate

Put the manifest.yml file with the migrations you wish to run in your D8 site root. Then go there on the command line and run the following command, using your D6 database credentials.

You can install Drupal 8 at this stage. If you do, be sure to enable all of the necessary modules. For example, if you use the Book module, it is not enabled by default, so you should enable it now or your book nodes will simply become a regular content type.

When Drupal 8 is no longer in beta the manifest.yml file will not be necessary unless you are doing some custom work. In most cases all that will be necessary is to put in the database credentials and the system will run all the migrations that the system knows about by default.

You will find a manifest.yml file attached to many Migrate issues that will enable you to begin the migration. Here is a sample of what I am using... I have added together many different issues and I run them all at the same time:

# user
- d6_user
- d6_user_profile_field
- d6_user_profile_field_instance
- d6_user_profile_entity_display
- d6_user_profile_entity_form_display
- d6_profile_values:user
- d6_filter_format
- d6_user_role
- d6_user_picture_entity_display
- d6_user_picture_entity_form_display
- d6_user_picture_file
- d6_user_picture_field
- d6_user_picture_field_instance
# taxonomy
- d6_taxonomy_vocabulary
- d6_taxonomy_settings
- d6_taxonomy_term
# nodes
- d6_node
- d6_node_revision
- d6_node_type
- d6_view_modes
- d6_filter_format
- d6_field_instance_per_form_display
- d6_field_instance_widget_settings
- d6_field_formatter_settings
- d6_field_instance
- d6_field
- d6_field_settings
- d6_node_settings
- d6_cck_field_values:*
- d6_cck_field_revision:*
# taxonomy fields
- d6_term_node_revision
- d6_term_node
- d6_vocabulary_entity_display
- d6_vocabulary_entity_form_display
- d6_vocabulary_field_instance
- d6_vocabulary_field
# blocks
- d6_block
- d6_menu
# custom blocks
- d6_custom_block
- d6_filter_format
# book
- d6_book
- d6_book_settings

Now that you have created a manifest.yml file in the Drupal 8 root directory you can run the migration.

drush migrate-manifest --legacy-db-url=mysql://d6user:d6pass@localhost/d6 manifest.yml

If you are using Drupal Tools (Acquia Dev Desktop), and if you have also put your D6 site into Dev Desktop, you will need to specify the port number. You can find your database settings by creating an AcquiaDevDesktop terminal and typing drush status to get the exact settings for your D6 site. The result should look something like this:

drush migrate-manifest --legacy-db-url=mysql://drupaluser:@127.0.0.1:33067/drupal_6 manifest.yml

Note that the database user for D6 is called "drupaluser" and it uses the local IP address and port number rather than the host name. Again, run drush status if you are having trouble connecting to verify these values.

Results

After you have run the migration check your work. Did things do what you expected? Post the results of your findings to the issue queue you of the item you were working on.

Was the result successful? If so, post the result.

Did something fail? Post the result.

Post your results! Don't be afraid to comment on Drupal.org. If you provide examples of your tests you will help the migration path improve.

Rolling back (starting over)
  • It is possible to re-run the migration. This can be helpful if you forgot to run a component, or if you have new items in the source site that you would like to add to the Drpual8 site.
  • To completely "roll-back" you really need to reinstall Drupal 8. To do this you must do three things: (1) empty your database, (2) delete settings.php, (3) remove the files folder completely.
Going further Category: DrupalDrupal 8Drupal Planet
Categories: Elsewhere

Deeson: Data visualisation of who's making Drupal 8

Sun, 28/09/2014 - 10:15

I've been having fun for the last few weeks building an interactive data visualisation tool, The Drupal8r, to show how the Drupal community is coming together to develop the next release, Drupal 8.

What is Drupal?

Drupal is a free open-source web development platform which is designed to support online content, community and commerce. We've been using it since 2007.

Because it is open-source and built, developed and maintained by a huge global community who constantly update it as technology evolves.

Drupal 8, the latest release, is coming soon.

There are more than half a million people in the Drupal community, all working to make it the best platform around and usually in their spare time. 

We wanted to celebrate the community's collaboration and show who is making some of the biggest contributions and commitments in getting Drupal 8 ready for launch. And so the idea for The Drupal8r was born.

The Drupal community

There are hundreds of people in the Drupal community who write the platform's core code as their community contribution (called the contributors). This code is tested and reviewed by a handful of people who then commit it to the core (known as the committers).

D3 data visualisation

I used the d3.js JavaScript library for manipulating documents based on data and Drupal git-log data to build a chart which displays the names of code contributors and committers with their corresponding Drupal 8 modules. At the moment you can view data from the latest 5000 commits to Drupal 8.

Have a go!

Have a play with The Drupal8r, our fun and interactive data visualisation tool to see who has committed and contributed to modules for the next release of Drupal 8. 

Come and play with The Drupal8r now.

For mobile users

The text is small for mobile users and our human eyes haven't quite caught up with technology yet. So, have a look at this short video to see how it works instead.

The Drupal8r data visualisation tool Keep in mind

When using it for just committers or contributors, the width of the connection represents the number of commits. When you are viewing both,  the width of the connection has no meaning. 

The Drupal8r can only show a certain amount of items on the page, by default The Drupal8r shows 100 items. It shows all the modules and committers, but the number of contributors are capped and grouped together under 'other'.

Four things The Drupal8r shows
  1. A lot of people contribute - getting Drupal 8 ready is a massive team effort. It isn't just one person contributing to each module, but many people. Thanks everyone!
  2. In terms of pure numbers, Alex Pott, Webchick, and Nathaniel Catchpole have been the most prolific contributors to the Drupal 8 project. Impressive stuff.
  3. But the number of commits isn't necessarily a reasonable measure of an individual's contribution. Dries Buytaert and Jennifer Hodgdon may have been focusing on the bigger issues. The core team have reviewed and tested more than 5000 bug patches and bring us close to Drupal 8's launch - what a feat.
  4. For those in the Drupal community, see if you can spot the person who is in there twice under different names...
Coming soon...

Next month I'm going to write another blog post over here on Labs about how I made The Drupal8r and the technologies used.

I'll be enhancing The Drupal8r over the next few months. I'm going to add an option to download more data to include in the chart and a contributor filter, so you'll be able to link to a particular contributor's commits.

Don't miss out on our development of the chart, so sign up to our newsletter below to keep in the loop.

Categories: Elsewhere

Unimity Solutions Drupal Blog: DrupalCon Amsterdam - Diary - Saturday 27th Sep

Sun, 28/09/2014 - 08:53

I am proud to receive a Grant from the Drupal Association to attend DrupalCon Amsterdam. As a note of thanking the community, I started Day 1 here, Saturday, 27th September Volunteering to help Tote Bag and Badge Stuffing activity at Onyx Lounge at Amsterdam Rai. 

Categories: Elsewhere

The Cherry Hill Company: Why Drupal, and some digression.

Fri, 26/09/2014 - 20:01

Recently, there was a thread stated by a frustrated Drupal user on the Code4Lib (Code for Libraries) mailing list. It drew many thoughtful and occasionally passionate responses. This was mine:

I think that it is widely conceded that it is a good idea to use the most suitable tool for a given task. But what does that mean? There is a long list of conditions and factors that go into selecting tools, some reflecting immediate needs, some reflecting long term needs and strategy, and others reflecting the availability of resources, and these interact in many ways, many of them problematic.

I have given the genesis of Cherry Hill’s tech evolution at the end of this missive. The short version is that we started focused on minimizing size and complexity while maximizing performance, and over time have moved to an approach that balances those agains building and maintenance cost along with human and infrastructure resource usage.

Among the lessons we have learned in the...

Read more »
Categories: Elsewhere

Appnovation Technologies: DrupalCamp Montreal 2014

Fri, 26/09/2014 - 19:16

The seventh annual DrupalCamp Montreal took place at McGill University on September 12nd and 13th.

var switchTo5x = false;stLight.options({"publisher":"dr-75626d0b-d9b4-2fdb-6d29-1a20f61d683"});
Categories: Elsewhere

Deeson: Take a look at our swag for DrupalCon Amsterdam

Fri, 26/09/2014 - 16:38
DrupalCon Amsterdam

Following the success of our DrupalCon t-shirt last year, Team Deeson is back and ready for the 'Dam armed with stickers, posters and a new tee to give away (because we're nice like that).

Deft with the Delft

This year we've taken The Netherlands' traditional and iconic Delftware as our inspiration for our DrupalCon Amsterdam tee - well, when in Amsterdam....

Drupal blossoms

Our swag has been produced by our insanely talented designer, Rachael Case.

Rachael reversed the colour scheme, and added elements of other ‘classic’ Dutch imagery, including a windmill (of course), tulips and a bike. But if you look closer, the tulips ‘blossoms’ out of the Drupal drop. We also have the Drupal logo perched jauntily on the bike. 

To finish it all off, we also added a rather tongue in cheek strapline, celebrating the ‘social’ side of Amsterdam...

Roll up, roll up! Tweet to get a tee

So if you want to grab your swag - tweet us @DeesonAgency and we’ll sort you out at DrupalCon Amsterdam. Zie je daar!

For posters and stickers, come and see us at stand 203 at DrupalCon for a chat. Don't leave it too late though, they have a habit of going fast!

See you there

So if you want swag, come and find us in Amsterdam between 29th September and 3rd October. John, Tim and I will be around to chat about all things Drupal, open-source and open data.

Categories: Elsewhere

Code Karate: Drupal 7 jReject Module

Fri, 26/09/2014 - 15:12
Episode Number: 170

In this DDoD we look at the jReject module. This module allows you to display a modal popup notifying the user / visitor that their browser is outdated and wont work well with the site. In the video, you will see that jReject comes with a wide variety of customizations to fit your brand and preferences.

Tags: DrupalDrupal 7Drupal PlanetTips and TricksJavascriptModal Forms
Categories: Elsewhere

Kristian Polso: My road to DrupalCon Amsterdam

Fri, 26/09/2014 - 12:50
My first trip to a DrupalCon is just about to start! The yearly DrupalCon Europe is held in Amsterdam from 29th of September to 3rd of October 2014. There are a lot of sessions to be seen, wide array of sprints, social events and much more.
Categories: Elsewhere

KYbest: Using PHP_CodeSniffer in PhpStorm

Fri, 26/09/2014 - 12:46

PHP_CodeSniffer is a PHP5 script, which can validate PHP, JavaScript and CSS type source codes according to the different coding standards. In other words, you can easily check your source code’s standardization with a script, instead of knowing every detail about the coding standards by heart. You can use PHP_CodeSniffer in different ways, for example you can run it simply from terminal but thanks for the PhpStorm’s built-in support it becomes a much more effective tool.

Categories: Elsewhere

DrupalCon Amsterdam: DrupalCon Amsterdam is almost here

Fri, 26/09/2014 - 12:09

It’s the Friday before DrupalCon Amsterdam, and we couldn’t be more excited for what’s in store. As we prepare to dive headlong into a week filled with fun, friends, and Drupal, there are a few things that all DrupalCon attendees (and would-be attendees) need to be aware of.

Late pricing ends today

At 23:59 tonight, ticket pricing will move to onsite prices. You’ll still be able to register for tickets online, but in order to get the late pricing you must register to attend DrupalCon Amsterdam before midnight tonight Amsterdam time.

DrupalCon Amsterdam is our biggest European DrupalCon yet

We’re thrilled to announce that over 2,000 people have registered to attend DrupalCon Amsterdam, which makes it our biggest European DrupalCon to date. With so many people signed up to attend, there will be tons of opportunities to network, learn, and make new friends.

The fun starts before Tuesday

Excited to get the DrupalCon party started? Many of our amazing community members are starting the celebration early: the Tour de Drupal is cruising across Europe, and a student training with over 200 attendees is happening right now, thanks to the local Dutch community.

We wish you safe travels on your way to Amsterdam. Whether you’re taking a plane, a train, a bike, a boat, or some other method of transportation, we hope that you have a fun and safe trip, and we can’t wait to celebrate the best community in Open Sourced with you.

See you in Amsterdam!

Categories: Elsewhere

Acquia: Ultimate Guide to Drupal 8: Episode 8 - Answers to Your Burning Questions

Fri, 26/09/2014 - 11:08

Welcome to the 8th and FINAL installment of an 8-part blog series we're calling "The Ultimate Guide to Drupal 8." Whether you're a site builder, module or theme developer, or simply an end-user of a Drupal website, Drupal 8 has tons in store for you! This blog series will attempt to enumerate the major changes in Drupal 8.

Categories: Elsewhere

Mediacurrent: Exploring the Picture Element Module (Part 1)

Fri, 26/09/2014 - 04:01

Responsive Web Design or RWD, has come a long way since it was first introduced in 2010, and you would think that by now, given the popularity of the subject, all things have been sorted out and all questions have been answered. Not quite.  RWD is a moving target that continues to evolve, but for the most part the majority of the techniques used to accomplish the goal of an adaptable website are unquestionable except one, images. 

Categories: Elsewhere

CMS Quick Start: Drupal 7 Login Methods and Module Roundup: Part 1

Thu, 25/09/2014 - 23:45
If your site relies on user engagement, chances are you are using Drupal's powerful built in user modules. Sometimes, however, it can be difficult to understand what tweaks you can make to the default login process to make it a better experience all around. Should you present the login form on every page? Where should you put it? What methods can you use to display the login form in unobtrusive ways? What action does your site take after someone logs in? We're going to be presenting an array of options to hopefully point you in the right direction.

read more

Categories: Elsewhere

Drupal Watchdog: Drupal 7 Form Building

Thu, 25/09/2014 - 19:45
Article

Static websites, comprising web pages that do not respond to any user input, may be adequate for listing information, but little else. Dynamic pages are what make the Web more than just interlinked digital billboards. The primary mechanism that enables this is the humble web form – whether a modest single button or a multi-page form with various controls that allow the user to input text, make choices, upload files, etc.

Anyone developing a new Drupal-based website will usually need to create forms for gathering data from users. There are at least two possible approaches to solving this problem: One approach mostly relies on Drupal core, and the other uses a contributed module dedicated to forms.

The Node Knows

If you understand how to create content types and attach fields to them, then that could be a straightforward way to make a form – not for creating nodes to be used later for other purposes, but solely for gathering user input. To add different types of form fields to a content type, you will need to install and enable the corresponding modules, all of which are available from Drupal.org's modules section.

Some of these modules are part of Drupal's core: File (for uploading files), List (for selection lists), Number (for integers, decimals, and floats), Options (for selection controls, checkboxes, and radio buttons), Taxonomy (for tagging content with terms), and Text (for single- and multi-line entry fields).

Other field-related modules have been contributed by the Drupal community, including:

Categories: Elsewhere

MariqueCalcus: Prius is in Alpha 15

Thu, 25/09/2014 - 10:51

Today, we are very excited to announce the latest release of our Drupal 8 theme Prius. Alongside a full support of Drupal 8 Alpha 15, we have included a number of new features. This release is particularly exciting as we are one step closer to an official launch of Drupal 8. Indeed, Drupal Alpha 15 is the first candidate for a Beta release. Meaning if no new beta blocker bugs are found within the next coming days1, we could see the first Beta version of our favourite "CMS" very soon.

Read More...
Categories: Elsewhere

Commerce Guys: Commerce Guys is pleased to sponsor Symfony live

Thu, 25/09/2014 - 08:00

The Symfony Live events of this Fall (London, Berlin, NYC, Madrid) are around the corner, and for the first year, Commerce Guys is going to attend these events as a sponsor. Some people are wondering why, and I’d like to explain why Commerce Guys is very excited to engage with the Symfony community and its open source software vendor, SensioLabs.

In fact, there are 3 main reasons for Commerce Guys’ interest in Symfony and working tightly with SensioLabs:

Drupal 8 and Drupal Commerce 2.0

It’s no secret that Drupal8 will rely on Symfony components. This architecture decision is good, and paved the way for similar thoughts on Drupal Commerce 2.0. It also ties the destinies of both open source communities, we think for the better. The work on Drupal Commerce for Drupal 8, known as Drupal Commerce 2.x, started in June 2014. During a community sprint that included members of SensioLabs and other partners like Smile, Publicis Modem, Osinet, i-KOS, Adyax, and Ekino, we validated the idea that some of the core eCommerce components of Drupal Commerce 2.x should rely on Symfony and other general PHP libraries directly. The goal is to offer an even more generic and flexible solution that spreads the impact of our code beyond the walls of the Drupal community.

This effort is well in progress already. Bojan Zivanovic, Drupal Commerce 2.x co-maintainer, provides a great example of this in a recent blog post about our new Internationalization library. He explains how much improvement this component will bring to the software for managing and formatting currencies internationally via a generic PHP library called commerceguys/intl. Expanding the reach of our work to the broader PHP community will help us get more feedback, more users, and more open source contributors, ultimately leading to better software. Ryan Szrama, Commerce Guys co-founder and Drupal Commerce CTO, will be presenting this approach at Symfony Live in New York City in October. We strongly believe this vision will bring us closer to our goal of building the most popular open source eCommerce software.

Platform.sh now refined for Symfony projects

In a context where Symfony will be central to mastering Drupal 8 projects, we’ve pursued the goal to enable our development & production Platform as a Service (PaaS) for Symfony projects in general. We’re convinced that this will provide Platform.sh an edge, and wanted to be a driving force in providing tools that will fit both open source communities.

Since Spring 2014, Commerce Guys engineers have been collaborating with SensioLabs engineers to understand Symfony better. Few companies in the world have the expertise in enterprise PHP that SensioLabs has, and the Platform.sh Symfony experience is the outcome of lots of intense discussions with the SensioLabs’ team.

Our objective was to enable teams to develop and deploy Symfony projects faster and more productively on Platform.sh. That work is now done and we’re very happy to announce today that, with just a few clicks, Symfony developers can create a full Symfony development environment (starting from an existing Symfony distribution), in order to build and deploy highly scalable websites and custom applications. This will lead to a much improved development process, lots of time saved for developers and a reduced time to market from development to production. Sponsoring Symfony live is a way for Commerce Guys to share the hard work we’ve done to build a unique, cloud-based development experience for Symfony developers. We’re excited to share our work and get feedback from the Symfony community about this product.

A shared focus on the developers

The time we’ve spent with SensioLabs’ management team highlighted our common passion and interest: help developers be more efficient and successful and, as much as it depends on us, to enjoy their jobs even more. SensioLabs and Commerce Guys were both founded to design and develop open source frameworks, gather large and global developer communities, and enable developers to create great web experiences. Both companies aim at making developers happier and more successful by providing them the right tools. It’s on these values and fundamental principles that this partnership was built. It’s all very solid and here to stay!

Categories: Elsewhere

DrupalCon Amsterdam: Win €100 to the Drupal Store

Wed, 24/09/2014 - 23:32

We're excited about the great swag we've got at the Drupal store-- so excited that we're going to award a €100 gift card to a lucky winner at DrupalCon Amsterdam!

Here's how it works.

On Tuesday and Wednesday, we are going to hide puzzle pieces around the RAI Convention center. (The puzzle, for reference, is above!) If you find one of the puzzle pieces, bring it by the Drupal Association Booth in the exhibit hall.

We'll write your name and contact information on the back, and once the puzzle is complete-- or, at lunch on Thursday, whichever happens first-- we will select a lucky winner and award him or her with a €100 gift card!

Pro tip: during the hours the exhibit floor is open, we'll use the @DrupalAssoc Twitter handle to send out pictures of where the puzzle pieces are hidden. Keep your eye on that handle so you can have a shot at finding one of the pieces and winning the prize!

Note: there are only 15 puzzle pieces, so the odds of winning are great. Limit one puzzle piece per person.

Questions?

Come by the Drupal Association booth next to the bookstore or email Leigh Carver with any questions you may have.

Good luck!

Categories: Elsewhere

Acquia: Drupal community engagement for businesses – Ruth Fuller

Wed, 24/09/2014 - 21:23

Meet Ruth Fuller, she's here to help businesses get more out of Drupal by helping them engage more effectively with the Drupal community. She'd like to help you with effective Drupal and open source sponsorship, how to engage with the community, planning, coordination, presentation preparation, and public speaking coaching.

Categories: Elsewhere

Drupal Commerce: Commerce 2.x Stories - Addressing

Wed, 24/09/2014 - 18:56

Welcome to the second article in the “Commerce 2.x Stories” series. This time we’re going to talk about addressing, and our efforts to improve the already good Commerce 1.x addressing implementation (addressfield).

By addressing we mean storing, manipulating and formatting postal addresses, meant to identify a precise recipient location for shipping or billing purposes.

Read on to see what we're doing to improve it...

Categories: Elsewhere

Deeson Online: Debugging Drupal with Drush in real time with PHPStorm and Xdebug

Wed, 24/09/2014 - 17:44

I am going to explain how to setup your development tools so that you can debug Drush commands in real time, as they run. I've tested these instructions on Mac OSX.

In a previous blog post I outlined how to configure PHPStorm and Xdebug so you can step through the code of a webpage as it is executed. This allowed you to set breakpoints and inspect the value of variables at specific points in the code. The same can be done for Drush commands. You will need to have configured your PHPStorm as described in the first blog post.

Add Drush code to PHPStorm

Drush can be added to PHPStorm as an external library. This will allow you to view the Drush code within PHPStorm so you can add break points to it later. 

1. In the project pane, double click external libraries, which appears at the bottom of the directories.

2. Click the plus button in the bottom left of the PHP popup window. Now use the file brower to find where Drush is installed on your system. Select the folder and click OK and OK again. Drush should now be listed as an external library.

3. Click the telephone button in PHPStorm so it starts listening for executed code.

Configuring Drush to tell PHPStorm it is running

In the command line where you normally run your Drush commands, first type the following command and press enter:

export PHP_OPTIONS="-dxdebug.remote_autostart=On -didekey=PHPSTORM -dremote_host=localhost -dprofiler_enable=1"

Now, when you run a Drush command it will be picked up by PHPStorm.

If you have put in a breakpoint, then execution of the command will pause at that point. For example, open index.php in your project and place a breakpoint next to a PHP function as shown in the image. If you click between the line number and the code, a red spot will appear.

Now, at the same command prompt where you entered the export command above, run a Drush command, for example:

drush cc all

PHPStorm should open at the breakpoint. Now you can step through the code in the same way as before.

Executing the export command before running Drush commands will be a little time consuming. I recommend you add this to your .bashrc file or .bash_profile file in your home directory so it's available as soon as you open your terminal.

To stop PHPStorm opening every time you run a Drush command, simply press the telephone button again and hang up.

Categories: Elsewhere

Pages