Last active
August 29, 2015 14:19
-
-
Save Luciaisacomputer/f7beb6a91307424ba8e9 to your computer and use it in GitHub Desktop.
WordPress version control for wp-config. Create a local config file, and then a dev config file on each server and you are set!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( file_exists( dirname( __FILE__ ) . '/wp-local-config.php' ) ) { | |
include( dirname( __FILE__ ) . '/wp-local-config.php' ); | |
define( 'WP_LOCAL_DEV', true ); //You can use this to further enable/disable things | |
}else if( file_exists( dirname( __FILE__ ) . '/wp-dev-config.php' ) ){ | |
include( dirname( __FILE__ ) . '/wp-dev-config.php' ); | |
define( 'WP_REMOTE_DEV', true ); //You can use this to further enable/disable things | |
}else{ | |
define('DB_NAME', 'db_name'); | |
/** MySQL database username */ | |
define('DB_USER', 'db_username'); | |
/** MySQL database password */ | |
define('DB_PASSWORD', 'db_password'); | |
/** MySQL hostname */ | |
define('DB_HOST', 'localhost'); | |
/** Database Charset to use in creating database tables. */ | |
define('DB_CHARSET', 'utf8'); | |
/** The Database Collate type. Don't change this if in doubt. */ | |
define('DB_COLLATE', ''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment