index.php 950 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use Chamilo\Kernel;
  4. use Symfony\Component\Debug\Debug;
  5. use Symfony\Component\HttpFoundation\Request;
  6. require dirname(__DIR__).'/config/bootstrap.php';
  7. if ($_SERVER['APP_DEBUG']) {
  8. umask(0000);
  9. Debug::enable();
  10. }
  11. if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
  12. Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
  13. }
  14. if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
  15. Request::setTrustedHosts([$trustedHosts]);
  16. }
  17. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  18. //$request = Request::createFromGlobals();
  19. $request = Sonata\PageBundle\Request\RequestFactory::createFromGlobals(
  20. 'host_with_path_by_locale'
  21. );
  22. $response = $kernel->handle($request);
  23. $response->send();
  24. $kernel->terminate($request, $response);