public/index.php line 28

Open in your IDE?
  1. <?php
  2. use App\Kernel;
  3. use Symfony\Component\Debug\Debug;
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Symfony\Component\Dotenv\Dotenv// JM 20211029 
  6. require dirname(__DIR__).'/config/bootstrap.php';
  7. if ($_SERVER['APP_DEBUG']) {
  8.     umask(0000);
  9.     Debug::enable();
  10. }
  11. // JM 20211029 Début  https://github.com/symfony/symfony/issues/35388
  12. //$o = new Dotenv() ;
  13. //(new Dotenv())->usePutenv(true)->bootEnv(dirname(__DIR__).'/.env');
  14. // JM 20211029 Fin 
  15. if ($trustedProxies $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
  16.     Request::setTrustedProxies(explode(','$trustedProxies), Request::HEADER_X_FORWARDED_ALL Request::HEADER_X_FORWARDED_HOST);
  17. }
  18. if ($trustedHosts $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
  19.     Request::setTrustedHosts([$trustedHosts]);
  20. }
  21. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  22. $request Request::createFromGlobals();
  23. $response $kernel->handle($request);
  24. // // LG 20220802 pour tests
  25. // if (file_exists("/home/luc/partage_win10/Poubelle/")) {
  26. //     $jsonfile = "/home/luc/partage_win10/Poubelle/comparePasswords.txt";
  27. // } else if (file_exists("/var/www/html/PAA/Recette/var/log/")) {
  28. //     $jsonfile = "/var/www/html/PAA/Recette/var/log/comparePasswords.txt";
  29. // } 
  30. // if (isset($jsonfile)) {
  31. //     $lsLog = "Index.php response->getStatusCode() : " . $response->getStatusCode() . chr(13) ;
  32. //     file_put_contents($jsonfile, $lsLog, FILE_APPEND | LOCK_EX);
  33. // }
  34. $response->send();
  35. $kernel->terminate($request$response);