public/index.php line 31

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. use Harmonizely\Kernel;
  4. use Symfony\Component\ErrorHandler\Debug;
  5. use Symfony\Component\HttpFoundation\Request;
  6. require dirname(__DIR__).'/config/bootstrap.php';
  7. if ($_SERVER['APP_DEBUG']) {
  8.     umask(0000);
  9.     Debug::enable();
  10. }
  11. if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
  12.     $ips explode(','$_SERVER['HTTP_X_FORWARDED_FOR']);
  13.     $_SERVER['REMOTE_ADDR'] = trim(end($ips));
  14. }
  15. if ($trustedProxies $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
  16.     Request::setTrustedProxies(explode(','$trustedProxies), Request::HEADER_X_FORWARDED_ALL);
  17. }
  18. if ($trustedHosts $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
  19.     Request::setTrustedHosts(explode(','$trustedHosts));
  20. }
  21. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  22. $request Request::createFromGlobals();
  23. $response $kernel->handle($request);
  24. $response->send();
  25. $kernel->terminate($request$response);