-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathindex.php
More file actions
36 lines (29 loc) · 1.09 KB
/
index.php
File metadata and controls
36 lines (29 loc) · 1.09 KB
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
<?php
use Outlandish\Wpackagist\Kernel;
use Symfony\Component\ErrorHandler\Debug;
use Symfony\Component\HttpFoundation\Request;
require dirname(__DIR__) . '/config/bootstrap.php';
if ($_SERVER['APP_DEBUG']) {
umask(0000);
Debug::enable();
}
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
} else {
/**
* If no env override, get the correct request context behind an AWS load balancer.
* @link https://symfony.com/doc/5.2/deployment/proxies.html
*/
Request::setTrustedProxies(
['127.0.0.1', 'REMOTE_ADDR'], // REMOTE_ADDR string replaced at runtime.
Request::HEADER_X_FORWARDED_AWS_ELB
);
}
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);