Skip to content

Instantly share code, notes, and snippets.

@kylehotchkiss
Last active December 16, 2015 19:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylehotchkiss/5485393 to your computer and use it in GitHub Desktop.
Save kylehotchkiss/5485393 to your computer and use it in GitHub Desktop.
Wordpress Config Addendum for hosting locally and hosting on Appfog.
<?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