Last active
December 16, 2015 19:29
-
-
Save kylehotchkiss/5485393 to your computer and use it in GitHub Desktop.
Wordpress Config Addendum for hosting locally and hosting on Appfog.
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 | |
/////////////////////////////////// | |
// Local and Production Settings // | |
/////////////////////////////////// | |
if ( strpos( $_SERVER['SERVER_NAME'], ".dev" ) ) { | |
///////////////////////////// | |
// Development / Localhost // | |
///////////////////////////// | |
define('DB_NAME', ''); | |
define('DB_USER', ''); | |
define('DB_PASSWORD', ''); | |
define('DB_HOST', ''); | |
define('WP_DEBUG', true); | |
} else { | |
////////////////////////// | |
// Staging / Production // | |
////////////////////////// | |
$appfog = json_decode( getenv("VCAP_SERVICES"), true ); | |
$mysql = $appfog["mysql-5.1"][0]["credentials"]; | |
define('DB_NAME', $mysql["name"]); | |
define('DB_USER', $mysql["username"]); | |
define('DB_PASSWORD', $mysql["password"]); | |
define('DB_HOST', $mysql["hostname"]); | |
define('WP_DEBUG', false); | |
define('DISALLOW_FILE_MODS', true); | |
} | |
define('DB_CHARSET', 'utf8'); | |
define('DB_COLLATE', ''); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment