Skip to content

Instantly share code, notes, and snippets.

@jolantis
Created August 26, 2010 10:11
Show Gist options
  • Save jolantis/551177 to your computer and use it in GitHub Desktop.
Save jolantis/551177 to your computer and use it in GitHub Desktop.
ee2 database.php
<?php
// Setup the environment
if (!defined('EE_ENV')) {
define('EE_SERVER_NAME', $_SERVER['SERVER_NAME']);
if ( strstr( EE_SERVER_NAME, '.local' ) ) define('EE_ENV', 'local');
elseif ( strstr( EE_SERVER_NAME, '.dev' ) ) define('EE_ENV', 'dev');
elseif ( strstr( EE_SERVER_NAME, '.stage' ) ) define('EE_ENV', 'stage');
else define('EE_ENV', 'production');
}
// Set the environmental config
if (EE_ENV == 'local') {
$db['expressionengine']['hostname'] = "";
$db['expressionengine']['username'] = "";
$db['expressionengine']['password'] = "";
$db['expressionengine']['database'] = "local-domain-com";
}
elseif (EE_ENV == 'dev') {
$db['expressionengine']['hostname'] = "";
$db['expressionengine']['username'] = "";
$db['expressionengine']['password'] = "";
$db['expressionengine']['database'] = "dev-domain-com";
} elseif (EE_ENV == 'stage') {
$db['expressionengine']['hostname'] = "";
$db['expressionengine']['username'] = "";
$db['expressionengine']['password'] = "";
$db['expressionengine']['database'] = "stage-domain-com";
} else {
$db['expressionengine']['hostname'] = "";
$db['expressionengine']['username'] = "";
$db['expressionengine']['password'] = "";
$db['expressionengine']['database'] = "domain-com";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment