public/index.php line 33

Open in your IDE?
  1. <?php
  2. use App\Kernel;
  3. use Symfony\Component\Debug\Debug;
  4. use Symfony\Component\HttpFoundation\Request;
  5. require dirname(__DIR__).'/config/bootstrap.php';
  6. if ( $_SERVER["HTTP_HOST"] == 'privatam.com' or ( strpos($_SERVER["HTTP_HOST"], 'privatam.com') !== false and @$_SERVER["HTTPS"] != "on") ) {
  7.     header("Status: 301 Moved Permanently"false301);
  8.     header("Location: https://www.privatam.com" $_SERVER["REQUEST_URI"]);
  9.     exit;
  10. }
  11. if ($_SERVER['APP_DEBUG']) {
  12.     umask(0000);
  13.     Debug::enable();
  14. }
  15. if ($trustedProxies $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
  16.     Request::setTrustedProxies(explode(','$trustedProxies), Request::HEADER_X_FORWARDED_ALL Request::HEADER_X_FORWARDED_HOST);
  17. }
  18. if ($trustedHosts $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
  19.     Request::setTrustedHosts([$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);