Created
February 16, 2012 19:45
-
-
Save robertcedwards/1847275 to your computer and use it in GitHub Desktop.
Hardened, cleaned up wp-config.php file for use with environmental variables
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 | |
/** @package WordPress */ | |
if ( file_exists( dirname( __FILE__ ) . '/local.php' ) ) { | |
include( dirname( __FILE__ ) . '/local.php' ); | |
define( 'WP_LOCAL_DEV', true ); // We'll talk about this later | |
} else { | |
/** Hardened database loop */ | |
$dbvalues = array('DB_HOST', 'DB_NAME', 'DB_USER', 'DB_PASSWORD'); | |
/** -------------------------------------------------------------*/ | |
foreach ($dbvalues as $dbvalue) {define($dbvalue, getenv($dbvalue));} | |
/** -------------------------------------------------------------*/ | |
/** Hardened Salty Key loop*/ | |
$saltykeys = array('AUTH_KEY', 'SECURE_AUTH_KEY', 'LOGGED_IN_KEY', 'NONCE_KEY', 'AUTH_SALT', 'SECURE_AUTH_SALT' , 'LOGGED_IN_SALT', 'NONCE_SALT' ); | |
/** -------------------------------------------------------------*/ | |
foreach ($saltykeys as $saltykey) {define($saltykey, getenv($saltykey));} | |
/** -------------------------------------------------------------*/ | |
} | |
/** the rest */ | |
$table_prefix = 'wp_'; | |
define('DB_CHARSET', 'utf8'); | |
define('DB_COLLATE', ''); | |
define('WPLANG', ''); | |
define('WP_DEBUG', false); | |
/** Absolute path to the WordPress directory. */ | |
if ( !defined('ABSPATH') ) | |
define('ABSPATH', dirname(__FILE__) . '/'); | |
/** -------------------------------------------------------------*/ | |
/* PHPFOG edit to patch a few issues of file saves, plugins, caching for Varnish */ | |
define('FS_METHOD', 'direct'); | |
define('WP_CACHE' , true); | |
require_once(ABSPATH . 'wp-settings.php'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment