2020-04-18 00:51:33 +02:00
|
|
|
<?php
|
|
|
|
|
2023-02-08 02:27:15 +01:00
|
|
|
use EesyPHP\App;
|
2024-02-18 17:21:54 +01:00
|
|
|
use EesyPHP\Db;
|
2023-01-29 18:17:50 +01:00
|
|
|
use EesyPHP\SentrySpan;
|
2023-01-29 17:36:21 +01:00
|
|
|
|
2023-03-22 18:12:43 +01:00
|
|
|
use function EesyPHP\___;
|
|
|
|
|
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;
|
2024-02-02 18:19:38 +01:00
|
|
|
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
|
2023-02-13 00:42:20 +01:00
|
|
|
require("$root_dir_path/vendor/autoload.php");
|
2020-04-18 00:51:33 +02:00
|
|
|
|
2023-02-08 02:27:15 +01:00
|
|
|
// Initialize EesyPHP application
|
|
|
|
App::init(
|
|
|
|
"$root_dir_path/includes/config.yml",
|
|
|
|
array(
|
|
|
|
'overwrite_config_files' => array(
|
|
|
|
"$root_dir_path/includes/config.local.yml",
|
|
|
|
),
|
2023-02-12 00:30:36 +01:00
|
|
|
'templates' => array(
|
|
|
|
'static_directories' => array(
|
|
|
|
"$root_dir_path/static"
|
|
|
|
),
|
|
|
|
),
|
2023-11-22 12:46:07 +01:00
|
|
|
'i18n' => array(
|
|
|
|
'default_locale' => "en_US.UTF8",
|
|
|
|
'extract_messages_excluded_paths' => array(
|
|
|
|
"static/lib"
|
|
|
|
),
|
|
|
|
),
|
2023-02-27 17:52:51 +01:00
|
|
|
'default' => array(
|
|
|
|
'upload_max_filesize' => 10485760,
|
|
|
|
),
|
2023-02-08 02:27:15 +01:00
|
|
|
),
|
|
|
|
$root_dir_path
|
2023-01-29 18:17:50 +01:00
|
|
|
);
|
2023-01-29 11:51:41 +01:00
|
|
|
|
|
|
|
$sentry_span = new SentrySpan('core.init', 'Core initialization');
|
|
|
|
|
2020-04-18 00:51:33 +02:00
|
|
|
require_once('functions.php');
|
|
|
|
|
|
|
|
require_once('cli.php');
|
2023-01-31 00:30:04 +01:00
|
|
|
require_once('templates.php');
|
2024-02-18 17:41:36 +01:00
|
|
|
require_once('views/index.php');
|
2024-02-02 18:19:38 +01:00
|
|
|
|
|
|
|
Db :: init();
|
2021-07-28 17:13:10 +02:00
|
|
|
|
2023-01-29 11:51:41 +01:00
|
|
|
$sentry_span->finish();
|
|
|
|
|
|
|
|
# vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab
|