2020-04-18 00:51:33 +02:00
|
|
|
<?php
|
|
|
|
|
2023-01-29 17:36:21 +01:00
|
|
|
use EesyPHP\Log;
|
2023-01-29 18:17:50 +01:00
|
|
|
use EesyPHP\SentryIntegration;
|
|
|
|
use EesyPHP\SentrySpan;
|
|
|
|
use EesyPHP\SentryTransaction;
|
2023-01-29 19:18:10 +01:00
|
|
|
use EesyPHP\Url;
|
2023-01-29 17:36:21 +01:00
|
|
|
|
2020-04-18 00:51:33 +02:00
|
|
|
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
|
|
|
|
|
|
|
|
// Root directory path
|
2023-01-29 11:51:41 +01:00
|
|
|
$script = null;
|
|
|
|
if (defined('__FILE__') && constant('__FILE__')) {
|
2022-04-24 17:43:44 +02:00
|
|
|
$script = __FILE__;
|
2020-04-18 00:51:33 +02:00
|
|
|
}
|
|
|
|
else {
|
2022-04-24 17:43:44 +02:00
|
|
|
// Fallback method : detect path from core.php path
|
|
|
|
foreach(get_included_files() as $script)
|
|
|
|
if (basename($script) == 'core.php')
|
|
|
|
break;
|
2020-04-18 00:51:33 +02:00
|
|
|
}
|
2023-01-29 11:51:41 +01:00
|
|
|
if (!$script) die('Fail to detect root directory path');
|
|
|
|
$root_dir_path = realpath(dirname($script).'/../');
|
2020-04-18 00:51:33 +02:00
|
|
|
|
|
|
|
// Include App's includes and vendor directories to PHP include paths
|
|
|
|
set_include_path($root_dir_path.'/includes' . PATH_SEPARATOR . get_include_path());
|
|
|
|
|
|
|
|
// Load composer autoload.php
|
|
|
|
require("$root_dir_path/vendor/autoload.php");
|
|
|
|
|
|
|
|
// Load configuration
|
2021-07-28 17:13:10 +02:00
|
|
|
require_once('translation.php');
|
2020-04-18 00:51:33 +02:00
|
|
|
require_once('config.inc.php');
|
|
|
|
|
2023-01-29 11:51:41 +01:00
|
|
|
// Load local configuration file is present
|
|
|
|
if (is_file("$root_dir_path/includes/config.local.php")) {
|
|
|
|
require "$root_dir_path/includes/config.local.php";
|
2020-04-18 00:51:33 +02:00
|
|
|
}
|
|
|
|
|
2023-01-29 18:17:50 +01:00
|
|
|
SentryIntegration :: init(
|
|
|
|
isset($sentry_dsn)?$sentry_dsn:null,
|
|
|
|
isset($sentry_traces_sample_rate)?$sentry_traces_sample_rate:null,
|
|
|
|
isset($sentry_php_error_types)?$sentry_php_error_types:null,
|
|
|
|
);
|
2023-01-29 11:51:41 +01:00
|
|
|
$sentry_transaction = new SentryTransaction();
|
|
|
|
|
|
|
|
$sentry_span = new SentrySpan('core.init', 'Core initialization');
|
|
|
|
|
2020-04-18 00:51:33 +02:00
|
|
|
// Define upload_tmp_dir
|
2023-01-29 11:51:41 +01:00
|
|
|
if (isset($upload_tmp_dir))
|
|
|
|
ini_set('upload_tmp_dir', $upload_tmp_dir);
|
2020-04-18 00:51:33 +02:00
|
|
|
|
2023-01-29 17:36:21 +01:00
|
|
|
if (!isset($log_file))
|
|
|
|
die('Log file path not configured');
|
|
|
|
Log::init(
|
|
|
|
$log_file,
|
|
|
|
isset($log_level)?$log_level:null,
|
|
|
|
isset($log_php_errors_levels)?$log_php_errors_levels:null
|
|
|
|
);
|
2020-04-18 00:51:33 +02:00
|
|
|
require_once('functions.php');
|
2020-11-18 18:53:47 +01:00
|
|
|
require_once('session.php');
|
2020-04-18 00:51:33 +02:00
|
|
|
|
|
|
|
// Nomenclatures
|
|
|
|
$status_list = array (
|
2021-07-28 17:13:10 +02:00
|
|
|
'pending' => ___('Pending'),
|
|
|
|
'validated' => ___('Validated'),
|
|
|
|
'refused' => ___('Refused'),
|
|
|
|
'archived' => ___('Archived'),
|
2020-04-18 00:51:33 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
require_once('hooks.php');
|
|
|
|
require_once('cli.php');
|
2022-04-24 16:46:38 +02:00
|
|
|
require_once('translation-cli.php');
|
2020-04-18 00:51:33 +02:00
|
|
|
require_once('smarty.php');
|
2023-01-29 19:18:10 +01:00
|
|
|
Url::init(isset($public_root_url)?$public_root_url:null);
|
2020-04-18 00:51:33 +02:00
|
|
|
require_once('url-helpers.php');
|
|
|
|
require_once('db.php');
|
2021-07-28 17:16:57 +02:00
|
|
|
require_once('mail.php');
|
2021-07-28 17:13:10 +02:00
|
|
|
|
|
|
|
// Initialize translation
|
|
|
|
init_translation();
|
|
|
|
foreach($status_list as $key => $value)
|
2022-04-24 17:43:44 +02:00
|
|
|
$status_list[$key] = _($value);
|
2023-01-29 11:51:41 +01:00
|
|
|
$sentry_span->finish();
|
|
|
|
|
|
|
|
# vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab
|