Skip to content

Instantly share code, notes, and snippets.

@daraul
Created April 23, 2015 03:02
Show Gist options
  • Save daraul/0d524c289501c765e09c to your computer and use it in GitHub Desktop.
Save daraul/0d524c289501c765e09c to your computer and use it in GitHub Desktop.
// The database URL to be parsed //
$url = parse_url(getenv("CLEARDB_DATABASE_URL"));
// The name of the database for WordPress //
define('DB_NAME', substr($url["path"], 1));
// MySQL database username //
define('DB_USER', $url["user"]);
// MySQL database password //
define('DB_PASSWORD', $url["pass"]);
// MySQL hostname //
define('DB_HOST', $url["host"]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment