Created
November 19, 2015 09:16
-
-
Save Da-Fecto/2807995bc9c57300bc21 to your computer and use it in GitHub Desktop.
Conditional SQL on config
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
/** | |
* Installer: HTTP Hosts Whitelist | |
* | |
*/ | |
$config->httpHosts = array('domain-01.dev', 'domain-02.dev', 'domain-03.dev', 'domain-04.ext'); | |
/** | |
* Development settings (Switch settings based on domainname.) | |
* | |
*/ | |
$config->develop_domains = array( | |
'domain-01.dev', | |
'domain-02.dev', | |
'domain-03.dev', | |
); | |
// Default Live | |
$config->dbHost = 'localhost'; | |
$config->dbName = 'domain-04-db'; | |
$config->dbUser = 'username'; | |
$config->dbPass = 'password'; | |
$config->dbPort = '3306'; | |
if (isset($_SERVER['HTTP_HOST']) && in_array($_SERVER['HTTP_HOST'], $config->develop_domains)) { | |
/** | |
* Database Configuration development environment(s). | |
* | |
*/ | |
// Develop | |
if ($_SERVER['HTTP_HOST'] == 'domain-01.dev') { | |
$config->dbHost = 'localhost'; | |
$config->dbName = 'domain-01-db'; | |
$config->dbUser = 'username'; | |
$config->dbPass = 'password'; | |
$config->dbPort = '3306'; | |
// Other place | |
} else if ($_SERVER['HTTP_HOST'] == 'domain-02.dev') { | |
$config->dbHost = 'localhost'; | |
$config->dbName = 'domain-02.dev'; | |
$config->dbUser = 'username'; | |
$config->dbPass = 'password'; | |
$config->dbPort = '3306'; | |
// Yet an other place | |
} else if ($_SERVER['HTTP_HOST'] == 'domain-03.dev') { | |
$config->dbHost = 'localhost'; | |
$config->dbName = 'domain-03.dev'; | |
$config->dbUser = 'username'; | |
$config->dbPass = 'password'; | |
$config->dbPort = '3306'; | |
} | |
$config->adminEmail = array("[email protected]", "[email protected]"); | |
$config->advanced = true; | |
$config->debug = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment