Last active
November 15, 2017 06:21
-
-
Save fjarrett/a3870e0ea120ab985c93 to your computer and use it in GitHub Desktop.
Replacement wp-config.php file for WP project repos
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
<?php | |
/** | |
* This is a `wp-config.php` replacement file for WP project repositories. | |
* | |
* It's purpose is to allow WP configurations such as database credentials, | |
* auth salts and other constants to be environment-agnostic and live outside | |
* of version control and outside the `public_html` docroot. | |
* | |
* Place your environment-specific `wp-config.php` one level above the docroot | |
* in a `config` dir. | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
define( 'ABSPATH', dirname( __FILE__ ) . '/' ); | |
} | |
if ( ! file_exists( ABSPATH . '../config/wp-config.php' ) ) { | |
echo '<pre>Error: No wp-config found!</pre>'; | |
die(); | |
} | |
require_once ABSPATH . '../config/wp-config.php'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment