2020-03-10 19:04:22 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use App\Kernel;
|
|
|
|
use Symfony\Component\ErrorHandler\Debug;
|
|
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
|
|
|
2020-03-15 21:21:11 +00:00
|
|
|
require dirname(__DIR__) . '/config/bootstrap.php';
|
2020-03-10 19:04:22 +00:00
|
|
|
|
|
|
|
if ($_SERVER['APP_DEBUG']) {
|
|
|
|
umask(0000);
|
|
|
|
|
|
|
|
Debug::enable();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
|
2020-03-15 21:21:11 +00:00
|
|
|
Request::setTrustedProxies(\explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
|
2020-03-10 19:04:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
|
|
|
|
Request::setTrustedHosts([$trustedHosts]);
|
|
|
|
}
|
|
|
|
|
2020-03-15 21:21:11 +00:00
|
|
|
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
|
|
|
|
$request = Request::createFromGlobals();
|
2020-03-10 19:04:22 +00:00
|
|
|
$response = $kernel->handle($request);
|
|
|
|
$response->send();
|
|
|
|
$kernel->terminate($request, $response);
|