-
Notifications
You must be signed in to change notification settings - Fork 0
/
Starter.php
executable file
·55 lines (47 loc) · 1.36 KB
/
Starter.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
<?php
/**
* This files enables to make verification of app .
* @since 0.09
* @author RAFINA DANY <[email protected]>
* @version 0.30
* @php_version 7.00 RTM
*/
use GException\{LoadingError};
use Compared\LayerConnector\MDA;
use Compared\Services\{TwigServices, MaintenanceServices, DatabaseServices, ComparatorServices};
class Starter {
public $isReady = 0;
public $isMaintenance = 0;
public function __construct()
{
$this->__autoloader();
$this->isReady = (new TwigServices())->start();
$this->isMaintenance = (new MaintenanceServices())->start();
$this->isReady = (new DatabaseServices())->start();
$this->initApp();
$this->isReady = (new ComparatorServices())->start("program");
}
private function __autoloader() {
try
{
include_once 'Autoloader.php';
$this->isReady = 1;
}
catch (Exception $e)
{
throw new LoadingError("Le chargeur de classe n'est pas disponible");
$this->isReady = 0;
}
}
private function initApp()
{
if (file_exists('Pointer.php'))
$this->isReady = 1;
else
{
$this->isReady = 0;
$loadingError = "Le routeur de l'application n'existe pas.";
throw new LoadingError($loadingError);
}
}
}