mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
26a6ac47a3
commit
a303a39d71
@ -73,8 +73,9 @@ global $database;
|
|||||||
|
|
||||||
// No database provided
|
// No database provided
|
||||||
if(!isset($database) || !$database) {
|
if(!isset($database) || !$database) {
|
||||||
// if SS_DATABASE_CHOOSE_NAME
|
if(defined('SS_DATABASE_NAME')) {
|
||||||
if(defined('SS_DATABASE_CHOOSE_NAME') && SS_DATABASE_CHOOSE_NAME) {
|
$database = SS_DATABASE_NAME;
|
||||||
|
} else if(defined('SS_DATABASE_CHOOSE_NAME') && SS_DATABASE_CHOOSE_NAME) {
|
||||||
$loopCount = (int)SS_DATABASE_CHOOSE_NAME;
|
$loopCount = (int)SS_DATABASE_CHOOSE_NAME;
|
||||||
$databaseDir = BASE_PATH;
|
$databaseDir = BASE_PATH;
|
||||||
for($i=0;$i<$loopCount-1;$i++) $databaseDir = dirname($databaseDir);
|
for($i=0;$i<$loopCount-1;$i++) $databaseDir = dirname($databaseDir);
|
||||||
|
Loading…
Reference in New Issue
Block a user