2018-06-20 16:35:08 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use App\Kernel;
|
|
|
|
use Symfony\Component\Debug\Debug;
|
|
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
|
|
|
2019-07-13 19:44:21 +00:00
|
|
|
require dirname(__DIR__).'/config/bootstrap.php';
|
2018-06-20 16:35:08 +00:00
|
|
|
|
2019-07-13 19:44:21 +00:00
|
|
|
if ($_SERVER['APP_DEBUG']) {
|
2018-06-20 16:35:08 +00:00
|
|
|
umask(0000);
|
|
|
|
|
|
|
|
Debug::enable();
|
|
|
|
}
|
|
|
|
|
2019-07-13 19:44:21 +00:00
|
|
|
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
|
2018-06-20 16:35:08 +00:00
|
|
|
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
|
|
|
|
}
|
|
|
|
|
2019-07-13 19:44:21 +00:00
|
|
|
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
|
|
|
|
Request::setTrustedHosts([$trustedHosts]);
|
2018-06-20 16:35:08 +00:00
|
|
|
}
|
|
|
|
|
2019-07-13 19:44:21 +00:00
|
|
|
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
|
2018-06-20 16:35:08 +00:00
|
|
|
$request = Request::createFromGlobals();
|
|
|
|
$response = $kernel->handle($request);
|
|
|
|
$response->send();
|
|
|
|
$kernel->terminate($request, $response);
|