Last active
May 18, 2017 12:52
-
-
Save jz5/3e821729ce8d57e44dec7b3cbc032989 to your computer and use it in GitHub Desktop.
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
<?php | |
$connectstr_dbhost = ''; | |
$connectstr_dbname = ''; | |
$connectstr_dbusername = ''; | |
$connectstr_dbpassword = ''; | |
foreach ($_SERVER as $key => $value) { | |
if (strpos($key, "MYSQLCONNSTR_") !== 0) { | |
continue; | |
} | |
$connectstr_dbhost = preg_replace("/^.*Data Source=(.+?);.*$/", "\\1", $value); | |
$connectstr_dbname = preg_replace("/^.*Database=(.+?);.*$/", "\\1", $value); | |
$connectstr_dbusername = preg_replace("/^.*User Id=(.+?);.*$/", "\\1", $value); | |
$connectstr_dbpassword = preg_replace("/^.*Password=(.+?)$/", "\\1", $value); | |
} | |
/** MySQL hostname */ | |
define('DB_HOST', $connectstr_dbhost); | |
/** The name of the database for WordPress */ | |
define('DB_NAME', $connectstr_dbname); | |
/** MySQL database username */ | |
define('DB_USER', $connectstr_dbusername); | |
/** MySQL database password */ | |
define('DB_PASSWORD', $connectstr_dbpassword); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment