Skip to content

Instantly share code, notes, and snippets.

@jester1979
Last active August 29, 2015 14:01
Show Gist options
  • Save jester1979/7f304de2b96e7e11d187 to your computer and use it in GitHub Desktop.
Save jester1979/7f304de2b96e7e11d187 to your computer and use it in GitHub Desktop.
Use a custom-config.php which can be excluded from Git
<?php
if ( file_exists( dirname( __FILE__ ) . '/custom-config.php' ) ) {
//this handy dandy file can be excluded from your Git or SVN repo!
//so each developer can use his/her own config :-)
include( dirname( __FILE__ ) . '/custom-config.php' );
} 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