public/index.php line 69

Open in your IDE?
  1. <?php
  2. use App\Kernel;
  3. use Symfony\Component\ErrorHandler\Debug;
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Symfony\Component\HttpFoundation\Session\Session;
  6. use Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage;
  7. ob_start();
  8. require dirname(__DIR__).'/config/bootstrap.php';
  9. require_once dirname(__DIR__).'/bb-legacy/app/defines.php';
  10. $isMobile false;
  11. $detection = new Mobile_Detect();
  12. $isMobile = ($detection->isMobile() || $detection->isTablet());
  13. if (!\defined('USER_TIMEZONE')) {
  14.     $GLOBALS['USER_TIMEZONE'] = date_default_timezone_get();
  15. }
  16. define('IS_MOBILE'$isMobile);
  17. /*
  18.  * The kernel will always be available globally, allowing you to
  19.  * access it from your existing application and through it the
  20.  * service container. This allows for introducing new features in
  21.  * the existing application.
  22.  */
  23. global $kernel;
  24. if ($_SERVER['APP_DEBUG']) {
  25.     umask(0000);
  26.     Debug::enable();
  27. }
  28. if ($trustedProxies $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
  29.     Request::setTrustedProxies(
  30.         explode(','$trustedProxies),
  31.         Request::HEADER_X_FORWARDED_ALL Request::HEADER_X_FORWARDED_HOST
  32.     );
  33. }
  34. if ($trustedHosts $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
  35.     Request::setTrustedHosts([$trustedHosts]);
  36. }
  37. ini_set("session.cookie_lifetime"172800);
  38. ini_set("session.gc_maxlifetime"172800);
  39. ini_set("session.cookie_domain"PARENT_DOMAIN);
  40. session_name(SESSION_NAME);
  41. session_start();
  42. $session = new Session(new PhpBridgeSessionStorage());
  43. // symfony will now interface with the existing PHP session
  44. $session->start();
  45. $kernel = new Kernel($_SERVER['APP_ENV'], (bool)$_SERVER['APP_DEBUG']);
  46. $request Request::createFromGlobals();
  47. // Restrict uris depending on environment.
  48. $uri substr($request->getPathInfo(), 1);
  49. $_GET['url'] = $uri;
  50. $response $kernel->handle($request);
  51. $response->send();
  52. $kernel->terminate($request$response);