public/app.php line 42

Open in your IDE?
  1. <?php
  2. use App\Kernel;
  3. use Symfony\Component\ErrorHandler\Debug;
  4. use Symfony\Component\HttpFoundation\Request;
  5. require dirname(__DIR__).'/config/bootstrap.php';
  6. //if ($_SERVER['APP_DEBUG']) {
  7. //    umask(0000);
  8.     Debug::enable();
  9. //}
  10. if ($trustedProxies $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
  11.     Request::setTrustedProxies(explode(','$trustedProxies), Request::HEADER_X_FORWARDED_ALL Request::HEADER_X_FORWARDED_HOST);
  12. }
  13. if ($trustedHosts $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
  14.     Request::setTrustedHosts([$trustedHosts]);
  15. }
  16. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  17. $request Request::createFromGlobals();
  18. // if ($request->getPathInfo() != "" && $request->getPathInfo() != "/") {
  19. //     $expl = explode('/', $request->getPathInfo());
  20. //     array_shift($expl);
  21. //     if (in_array($expl[0], ['en', 'ru', 'lv', 'se', 'no', 'lt'])) {
  22. //         $_REQUEST['cultureKey'] = $expl[0];
  23. //         array_shift($expl);
  24. //         if (count($expl) > 0 && !empty($expl[0]) ) {
  25. //             $_REQUEST['q'] = join('/', $expl);
  26. //             $page = substr( $_REQUEST['q'], 0, 5 ) === "page/";
  27. //             $webinar = substr( $_REQUEST['q'], 0, 8 ) === "webinar/";
  28. //             if ($_REQUEST['q'] != 'form/contact_ajax' && !$page && !$webinar) {
  29. //                 include(dirname(__FILE__) . '/index.php');
  30. //                 return;
  31. //             }
  32. //         }
  33. //     }
  34. // }
  35. $response $kernel->handle($request);
  36. $response->send();
  37. $kernel->terminate($request$response);