Created
January 7, 2013 10:31
-
-
Save anonymous/4473968 to your computer and use it in GitHub Desktop.
Use this in wp-config to be able to run the blog both locally and deployed on AppFog.
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
$services = getenv("VCAP_SERVICES"); | |
if ( $services != null){ | |
$services_json = json_decode($services,true); | |
$mysql_config = $services_json["mysql-5.1"][0]["credentials"]; | |
define('DB_NAME', $mysql_config["name"]); | |
define('DB_USER', $mysql_config["user"]); | |
define('DB_PASSWORD', $mysql_config["password"]); | |
define('DB_HOST', $mysql_config["hostname"]); | |
define('DB_PORT', $mysql_config["port"]); | |
} | |
else{ | |
define('DB_NAME', "localdb"); | |
define('DB_USER', "root"); | |
define('DB_PASSWORD', "password"); | |
define('DB_HOST', "localhost"); | |
define('DB_PORT', 8889); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment