-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.php
60 lines (48 loc) · 1.62 KB
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
declare(strict_types = 1);
$startTime = microtime(true);
/* -----------------------------------------------------------------------
* PassionEngine
* The blue passionflower CMS Engine, written with love and passion.
* ----------------------------------------------------------------------- */
use PassionEngine\Engine\Core\CoreSecure;
use PassionEngine\Engine\Core\CoreMain;
use PassionEngine\Engine\Exec\ExecTimeMarker;
/**
* Détermine si le mode debug est activé.
*
* @link https://github.com/MetallicBlueDev/PassionEngine/wiki/Debugging-mode
* @var bool
*/
define('PASSION_ENGINE_DEBUGMODE',
(bool) file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'Includes' . DIRECTORY_SEPARATOR . 'debugmode'));
/**
* Marque le passage dans l'index.
*
* @var bool
*/
define('PASSION_ENGINE_BOOTSTRAP',
true);
// Chargement et exécution de la sécurité
require __DIR__ . DIRECTORY_SEPARATOR . 'Engine' . DIRECTORY_SEPARATOR . 'SecurityCheck.php';
if (PASSION_ENGINE_DEBUGMODE) {
ExecTimeMarker::startMeasurement('all',
$startTime);
unset($startTime);
}
try {
// Mesure principal utilisable en permanence
ExecTimeMarker::startMeasurement('main');
// Préparation du moteur
CoreMain::checkInstance();
// Recherche de nouveaux composants
if (CoreMain::getInstance()->newComponentDetected()) {
// Installation des nouveaux composants
CoreMain::getInstance()->install();
} else {
// Démarrage classique
CoreMain::getInstance()->start();
}
} catch (\Throwable $ex) {
CoreSecure::getInstance()->catchException($ex);
}