public/index.php line 18

Open in your IDE?
  1. <?php
  2. use App\Kernel;
  3. if (
  4.     (!isset($_SERVER['HTTPS']) || 'off' === strtolower((string) $_SERVER['HTTPS']))
  5.     && (
  6.         (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && str_contains(strtolower((string) $_SERVER['HTTP_X_FORWARDED_PROTO']), 'https'))
  7.         || (isset($_SERVER['HTTP_FORWARDED']) && str_contains(strtolower((string) $_SERVER['HTTP_FORWARDED']), 'proto=https'))
  8.         || (isset($_SERVER['HTTP_X_FORWARDED_SSL']) && 'on' === strtolower((string) $_SERVER['HTTP_X_FORWARDED_SSL']))
  9.         || (isset($_SERVER['HTTP_FRONT_END_HTTPS']) && 'on' === strtolower((string) $_SERVER['HTTP_FRONT_END_HTTPS']))
  10.     )
  11. ) {
  12.     $_SERVER['HTTPS'] = 'on';
  13.     $_SERVER['SERVER_PORT'] = 443;
  14. }
  15. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  16. return function (array $context) {
  17.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  18. };