Created
April 21, 2014 04:33
-
-
Save andrezrv/11132305 to your computer and use it in GitHub Desktop.
Basic model of a wp-config.php file for different stages
This file contains hidden or 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
<?php | |
/** | |
* Load different configuration files for different stages. | |
*/ | |
if ( file_exists( $local_config = dirname( __FILE__ ) . '/local-config.php' ) ) { | |
require $local_config; // Configurations for your local stage only. | |
define( 'WP_STAGE', 'local' ); | |
} elseif ( file_exists( $staging_config = dirname( __FILE__ ) . '/staging-config.php' ) ) { | |
require $staging_config; // Configurations for your testing stage only. | |
define( 'WP_STAGE', 'staging' ); | |
} else { | |
define( 'WP_STAGE', 'production' ); | |
} | |
// Your usual code here... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment