Allow SS_DATABASE_NAME in _ss_environment.php configuration

Makes setups which are completely driven by that file a bit easier
to automate, particularly if the same codebase is deployed
multiple times (e.g. to a staging and live instance)
This commit is contained in:
Ingo Schommer 2013-04-22 14:14:32 +02:00
parent 26a6ac47a3
commit a303a39d71

View File

@ -73,8 +73,9 @@ global $database;
// No database provided
if(!isset($database) || !$database) {
// if SS_DATABASE_CHOOSE_NAME
if(defined('SS_DATABASE_CHOOSE_NAME') && SS_DATABASE_CHOOSE_NAME) {
if(defined('SS_DATABASE_NAME')) {
$database = SS_DATABASE_NAME;
} else if(defined('SS_DATABASE_CHOOSE_NAME') && SS_DATABASE_CHOOSE_NAME) {
$loopCount = (int)SS_DATABASE_CHOOSE_NAME;
$databaseDir = BASE_PATH;
for($i=0;$i<$loopCount-1;$i++) $databaseDir = dirname($databaseDir);