This repo is created for the SplendidBear Websites' portfolio. https://www.splendidbear.org
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
839B

  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. if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {
  13. Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
  14. }
  15. if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {
  16. Request::setTrustedHosts([$trustedHosts]);
  17. }
  18. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  19. $request = Request::createFromGlobals();
  20. $response = $kernel->handle($request);
  21. $response->send();
  22. $kernel->terminate($request, $response);