Skip to content

Instantly share code, notes, and snippets.

@jester1979
Last active August 29, 2015 14:00
Show Gist options
  • Save jester1979/0d385c71a0e8b3f4b280 to your computer and use it in GitHub Desktop.
Save jester1979/0d385c71a0e8b3f4b280 to your computer and use it in GitHub Desktop.
DTAP-database-config.php
<?php
if ( false !== stripos( $_SERVER['SERVER_NAME'], 'development' ) ) {
//development config goes here
} elseif ( false !== stripos( $_SERVER['SERVER_NAME'], 'testing' ) ) {
//testing config goes here
} elseif ( false !== stripos( $_SERVER['SERVER_NAME'], 'acceptance' ) ) {
//acceptance config goes here
} else {
//production config goes here, example:
define( 'DB_NAME', 'projectname_prod' );
define( 'DB_USER', 'projectname_prod_user' );
define( 'DB_PASSWORD', '12345' );
define( 'DB_HOST', 'localhost' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment