diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-04-19 13:15:41 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+github@gmail.com> | 2024-04-22 09:52:52 +0200 |
| commit | 2e6dcf74789c8ee316fc6c8d54ff5da20fa650c4 (patch) | |
| tree | 24406c647f7be38dcc01d201f41fdc80d1f48511 /lib/bootstrap.php | |
| parent | 349cf938b7328a73149c9fc51d14dd8a090e435d (diff) | |
fixes #4034
Closes #4034
Merge request studip/studip!2889
Diffstat (limited to 'lib/bootstrap.php')
| -rw-r--r-- | lib/bootstrap.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/bootstrap.php b/lib/bootstrap.php index 3ca342c..f146c60 100644 --- a/lib/bootstrap.php +++ b/lib/bootstrap.php @@ -64,6 +64,16 @@ if (isset($_SERVER['SERVER_NAME'])) { // default ASSETS_URL, customize if required $GLOBALS['ASSETS_URL'] = $ABSOLUTE_URI_STUDIP . 'assets/'; +// Check if instance is configured; redirect to install script if not +if (!file_exists($GLOBALS['STUDIP_BASE_PATH'] . '/config/config_local.inc.php') && php_sapi_name() !== 'cli') { + require_once __DIR__ . '/classes/URLHelper.php'; + + URLHelper::setBaseUrl($GLOBALS['ABSOLUTE_URI_STUDIP']); + header('Location: ' . URLHelper::getURL('install.php')); + die; +} + +// Load configuration require __DIR__ . '/classes/StudipFileloader.php'; $added_configs = []; @@ -79,14 +89,6 @@ if (!defined('Studip\ENV')) { define('Studip\ENV', DEFAULT_ENV); } -if (!file_exists($GLOBALS['STUDIP_BASE_PATH'] . '/config/config_local.inc.php') && php_sapi_name() !== 'cli') { - require_once __DIR__ . '/classes/URLHelper.php'; - - URLHelper::setBaseUrl($GLOBALS['ABSOLUTE_URI_STUDIP']); - header('Location: ' . URLHelper::getURL('install.php')); - die; -} - require __DIR__ . '/bootstrap-autoload.php'; // construct absolute URL for ASSETS_URL |
