New Drupal module: Environment Indicator
The Environment Indicator adds a coloured strip to the side of the site informing you which environment you're currently in (Development, Staging, Production etc). This is incredibly useful if you have multiple environments for each of your sites, and like me, are prone to forgetting which version of the site you are currently looking at.
This module can help you avoid making configuration changes to your live server by mistake by adding a coloured strip to the side of your site, clearly marking each version of the site.
The Environment Indicator settings page allows you to modify some elements of the indicator's behaviour and appearance. Individual settings, such as the text to display and the colour can be overridden for each of your specific environments in the site's settings.php file. This allows you to customise the indicator for each of your environments without needing to make any changes in the database. This means that the Environment Indicator will always display correctly when moving your site from development to staging to production.
Settings that can be overridden in settings.php include:
- environment_indicator_text
- The text that will be displayed vertically down the indicator. e.g: $conf['environment_indicator_text'] = 'DEVELOPMENT SERVER';
- environment_indicator_color
- A valid css color. e.g: $conf['environment_indicator_color'] = 'dark-red';
- environment_indicator_enabled
- A boolean value indicating whether the Environment Indicator should be enabled or not. On your production environment, you should probably set this to FALSE. e.g: $conf['environment_indicator_enabled'] = FALSE;
The Environment Indicator's visibility depends upon the permissions of the viewer (access environment indicator), although it can be completely disabled by setting environment_indicator_enbled = FALSE; in settings.php.
What follows are my settings.php overrides for each of my versions of kirkdesigns.co.uk - my development server (laptop), staging server (home server) and live server (a 512 slice provided by slicehost).
Development server
On my local machine, I colour the strip blue...
$conf['environment_indicator_text'] = 'DEVELOPMENT SERVER'; $conf['environment_indicator_color'] = 'blue';
Staging server
Orange seems like an appropriate colour for a staging server...
$conf['environment_indicator_text'] = 'STAGING SERVER'; $conf['environment_indicator_color'] = 'orange';
Live server
On my live server, I don't want the indicator to show at all, so I completely disable it...
$conf['environment_indicator_enabled'] = FALSE;
Please visit the project page on drupal.org to download, test and report any problems of feature requests.

Comments
Post new comment