Skip to content

Instantly share code, notes, and snippets.

@nathanpitman
Created October 28, 2011 13:40
Show Gist options
  • Save nathanpitman/1322288 to your computer and use it in GitHub Desktop.
Save nathanpitman/1322288 to your computer and use it in GitHub Desktop.
If you're using ExpressionEngine 2 and you want to have a global variable which you can use to conditionally include content in a dev environment just paste this switch statement into your index.php file at around about line 95.
switch ($_SERVER['HTTP_HOST']) {
//development
case 'dev.example.com':
$assign_to_config['global_vars']['site_mode'] = 'dev';
break;
//default
default:
$assign_to_config['global_vars']['site_mode'] = 'live';
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment