-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.php
48 lines (39 loc) · 998 Bytes
/
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
<?PHP
/**
* @copyright (2019 - 2024) - N'Guessan Kouadio Elisée ([email protected])
* @license MIT (https://opensource.org/licenses/MIT)
* @link https://github.com/eliseekn/tinymvc
*/
use Core\Routing\Route;
use Core\Support\Config;
use Core\Support\Storage;
/**
* Application initialization
*/
set_time_limit(0);
set_exception_handler(function ($e) {
throw new ErrorException(
$e->getMessage(),
$e->getCode(),
1,
$e->getFile(),
$e->getLine(),
$e->getPrevious()
);
});
const APP_ROOT = __DIR__ . DIRECTORY_SEPARATOR;
Storage::init();
Config::loadEnv();
Route::load();
if (config('errors.display')) {
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
} else {
ini_set('display_errors', 0);
}
if (config('errors.log')) {
ini_set('log_errors', 1);
ini_set('error_log', Storage::path(config('storage.logs'))->file('tinymvc_' . date('m_d_y') . '.log'));
} else {
ini_set('log_errors', 0);
}