public/index.php line 31

Open in your IDE?
  1. <?php
  2. use App\Kernel;
  3. use Symfony\Component\Dotenv\Dotenv;
  4. use Symfony\Component\ErrorHandler\Debug;
  5. use Symfony\Component\HttpFoundation\Request;
  6. require dirname(__DIR__).'/vendor/autoload.php';
  7. (new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
  8. if ($_SERVER['APP_DEBUG']) {
  9.     umask(0000);
  10.     Debug::enable();
  11. }
  12. header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
  13. header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, X-Requested-With");
  14. if ($trustedProxies $_SERVER['TRUSTED_PROXIES'] ?? false) {
  15.     Request::setTrustedProxies(explode(','$trustedProxies), Request::HEADER_X_FORWARDED_ALL Request::HEADER_X_FORWARDED_HOST);
  16. }
  17. if ($trustedHosts $_SERVER['TRUSTED_HOSTS'] ?? false) {
  18.     Request::setTrustedHosts([$trustedHosts]);
  19. }
  20. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  21. $request Request::createFromGlobals();
  22. $response $kernel->handle($request);
  23. $response->send();
  24. $kernel->terminate($request$response);