-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
40 lines (29 loc) · 1005 Bytes
/
Copy pathindex.php
File metadata and controls
40 lines (29 loc) · 1005 Bytes
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
<?php
use Jenssegers\Date\Date;
error_reporting(E_ALL);
try {
require_once __DIR__ . '/vendor/autoload.php';
ini_set('error_log', LOGS_PATH . '/php_errors.log');
require_once CONFIGURATIONS_PATH . '/environment.php';
require_once CONFIGURATIONS_PATH . '/container.php';
require_once CONFIGURATIONS_PATH . '/flight.php';
require_once ROUTES_PATH . '/web.php';
require_once ROUTES_PATH . '/api.php';
date_default_timezone_set($_ENV['TIMEZONE']);
Date::setLocale($_ENV['LOCALE']);
Flight::start();
} catch (Throwable $error) {
error_log($error->__toString());
$trace = $error->getTrace();
$filteredTrace = array_filter(
$trace,
static fn(array $call): bool => array_key_exists('file', $call) && !str_contains($call['file'] ?? '', 'vendor')
);
$mappedTrace = array_map(
static fn(array $call): string => @"{$call['file']}:{$call['line']}",
$filteredTrace
);
echo '<pre>', $error->getMessage(), PHP_EOL;
print_r($mappedTrace);
exit('</pre>');
}