diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-05-06 09:21:07 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2024-05-06 09:21:07 +0000 |
| commit | e2df6525b5b19f2ead4967630c437b89558afcf3 (patch) | |
| tree | ca66753c52a488fd65e4685ba506511534ae44da /lib/bootstrap.php | |
| parent | 06629e19ca03c3431a64302a18a1ff2a2f011be1 (diff) | |
allow setting configuration by environment variables, fixes #3560
Closes #3560
Merge request studip/studip!2875
Diffstat (limited to 'lib/bootstrap.php')
| -rw-r--r-- | lib/bootstrap.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/bootstrap.php b/lib/bootstrap.php index 06ddca5..364f9d9 100644 --- a/lib/bootstrap.php +++ b/lib/bootstrap.php @@ -9,8 +9,16 @@ * the License, or (at your option) any later version. */ +// Include composer's autoload +require __DIR__ . '/../composer/autoload.php'; + +// Load enviroment +$dot_env_path = __DIR__ . '/..'; +$dotenv = \Dotenv\Dotenv::createImmutable($dot_env_path); +$dotenv->safeLoad(); + // Default environment, do not change. Change in config/config_local.inc.php. -const DEFAULT_ENV = 'production'; +define('DEFAULT_ENV', $_ENV['STUDIP_ENV'] ?? 'production'); //software version - please leave it as it is! $SOFTWARE_VERSION = '6.0.alpha'; |
