public/index.php line 27

Open in your IDE?
  1. <?php
  2. ini_set("display_errors"1);
  3. error_reporting(E_ALL);
  4. header('Access-Control-Allow-Origin: *');
  5. use App\Kernel;
  6. use Symfony\Component\Debug\Debug;
  7. use Symfony\Component\Dotenv\Dotenv;
  8. use Symfony\Component\HttpFoundation\Request;
  9. require __DIR__.'/../vendor/autoload.php';
  10. // The check is to ensure we don't use .env in production
  11. if (!isset($_SERVER['APP_ENV'])) {
  12.     (new Dotenv())->load(__DIR__.'/../.env');
  13. }
  14. if ($_SERVER['APP_DEBUG'] ?? false) {
  15.     umask(0000);
  16.     Debug::enable();
  17. }
  18. // Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);
  19. $kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev'$_SERVER['APP_DEBUG'] ?? false);
  20. $request Request::createFromGlobals();
  21. $response $kernel->handle($request);
  22. $response->send();
  23. $kernel->terminate($request$response);