Skip to content

Instantly share code, notes, and snippets.

@scottlee
Created February 8, 2012 01:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottlee/1764206 to your computer and use it in GitHub Desktop.
Save scottlee/1764206 to your computer and use it in GitHub Desktop.
Check current environment, set appropriate variables
/*
* Check for the current environment
*/
//define('WP_CACHE', true); //Added by WP-Cache Manager
if ($_SERVER["HTTP_HOST"] === 'domain.com') {
$db_name = 'dbname';
$db_user = 'dbuser';
$password = 'dbass';
} else if ($_SERVER["HTTP_HOST"] === 'local') {
$db_name = 'localdb';
$db_user = 'localuser';
$password = 'localpass';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment