public/index.php line 34

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. if (isset($_SERVER['HTTP_ORIGIN'])) {
  8.     header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
  9.     header('Access-Control-Allow-Credentials: true');
  10.     header('Access-Control-Max-Age: 86400');
  11. }
  12. if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
  13.     header("HTTP/1.1 200 OK");
  14.     if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']))
  15.         header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
  16.     if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']))
  17.         header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
  18. }
  19. (new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
  20. if ($_SERVER['APP_DEBUG']) {
  21.     umask(0000);
  22.     Debug::enable();
  23. }
  24. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  25. $request Request::createFromGlobals();
  26. $response $kernel->handle($request);
  27. $response->send();
  28. $kernel->terminate($request$response);