Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

Module Spotlight #2: Environment Indicator

Parent Feed: 

Configuration > System > Backup and Migrate > Restore database..... Did I just load my database export on the live website? oops

If the stress of pressing the wrong button on a live website is familiar to you, you need the Environment Indicator module! On large Drupal projects you will often be using multiple environments. Local development, online development, test, acceptance and finally 'production'. Environments are easily mixed up as they probably look identical in every way except the url in the address bar.

To help you keep sane the environment indicator module will tell you clearly which environment you are currently looking at. Until recently it showed a, frankly rather unpretty, vertical bar adjacent to your page. With a recent update the module got an aesthetic make-over. Now the environment is indicated by coloring the toolbar and adding a label to the toolbar. This is integrated seamlessly with a number of different toolbars, including my favorite: Admin Menu toolbar. I've been testing this version of Environment Indicator for a few weeks now and I really like it. Using a green toolbar on dev, pink on test and red on the production environment I'm always 100% confident about which environment I'm working in. Even after importing a product database into a local development installation...

Regex matching your hostname

If you move content or configuration between your environments by copying over the database, in previous versions this would overwrite your setting environment setting. The latest branch of the module is smarter: it supports Hostname matching to make your site aware of its environment even if after copying around databases:

By entering a regular expression in the Hostname field: .*\.dev.* the module knows that any environment that lives on a .dev hostname should get the green color and "Development" label. I develop sooperthemes.com on a hostname called sooper6.dev, so I get a green label. If I create a new environment at sooper6-jQuery2.dev it will automatically get the development indication as well.  

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web