2014-02-10 06:36:00 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2015-06-24 16:48:52 +02:00
|
|
|
* @link https://www.humhub.org/
|
2017-01-26 17:36:59 +01:00
|
|
|
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
|
2015-06-24 16:48:52 +02:00
|
|
|
* @license https://www.humhub.com/licences
|
2014-02-10 06:36:00 +01:00
|
|
|
*/
|
2015-07-01 05:09:57 +02:00
|
|
|
|
2024-09-05 17:15:16 +04:00
|
|
|
require(__DIR__ . '/protected/vendor/autoload.php');
|
2023-08-12 14:40:38 +02:00
|
|
|
|
2024-09-05 17:15:16 +04:00
|
|
|
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__, '.env');
|
|
|
|
$dotenv->safeLoad();
|
2014-02-10 06:36:00 +01:00
|
|
|
|
2024-09-05 17:15:16 +04:00
|
|
|
$dynamicConfig = (is_readable(__DIR__ . '/protected/config/dynamic.php')) ? require(__DIR__ . '/protected/config/dynamic.php') : [];
|
2024-12-15 05:26:50 +04:00
|
|
|
$debug = filter_var($_ENV['HUMHUB_DEBUG'] ?? false, FILTER_VALIDATE_BOOLEAN) || !filter_var($dynamicConfig['params']['installed'] ?? false, FILTER_VALIDATE_BOOLEAN);
|
2015-07-01 05:09:57 +02:00
|
|
|
|
2024-09-05 17:15:16 +04:00
|
|
|
defined('YII_DEBUG') or define('YII_DEBUG', $debug);
|
|
|
|
defined('YII_ENV') or define('YII_ENV', $debug ? 'dev' : 'prod');
|
|
|
|
|
|
|
|
|
|
|
|
require(__DIR__ . '/protected/vendor/yiisoft/yii2/Yii.php');
|
2015-07-01 05:09:57 +02:00
|
|
|
|
2024-12-18 18:33:54 +04:00
|
|
|
|
2015-07-01 05:09:57 +02:00
|
|
|
$config = yii\helpers\ArrayHelper::merge(
|
|
|
|
require(__DIR__ . '/protected/humhub/config/common.php'),
|
|
|
|
require(__DIR__ . '/protected/humhub/config/web.php'),
|
2015-07-16 13:33:28 +02:00
|
|
|
require(__DIR__ . '/protected/config/common.php'),
|
2024-09-05 17:15:16 +04:00
|
|
|
require(__DIR__ . '/protected/config/web.php'),
|
|
|
|
$dynamicConfig,
|
2024-12-18 20:44:43 +04:00
|
|
|
humhub\helpers\EnvHelper::toConfig($_ENV, \humhub\components\Application::class),
|
2015-07-01 05:09:57 +02:00
|
|
|
);
|
2014-02-10 06:36:00 +01:00
|
|
|
|
2023-08-12 14:40:38 +02:00
|
|
|
try {
|
|
|
|
(new humhub\components\Application($config))->run();
|
2024-09-05 17:15:16 +04:00
|
|
|
} catch (Throwable $e) {
|
|
|
|
if (null === humhub\helpers\DatabaseHelper::handleConnectionErrors($e)) {
|
|
|
|
throw $e;
|
2023-08-12 14:40:38 +02:00
|
|
|
}
|
|
|
|
}
|