<?php
declare(strict_types=1);
use App\Kernel;
use Symfony\Component\ErrorHandler\Debug;
use Symfony\Component\HttpFoundation\Request;
require dirname(__DIR__) . '/config/bootstrap.php';
if ($_SERVER['APP_DEBUG']) {
umask(0000);
// https://github.com/symfony/symfony/issues/35575
$showDeprecations = $_ENV['APP_CONSOLE_DEPRECATIONS'] ?? $_SERVER['APP_CONSOLE_DEPRECATIONS'] ?? false;
$showDeprecations = filter_var($showDeprecations, \FILTER_VALIDATE_BOOLEAN);
\App\Component\ErrorHandler\DebugErrorHandler::enable(false);
}
//if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
// $ip = $_SERVER['HTTP_CLIENT_IP'];
//} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
// $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
//} else {
// $ip = $_SERVER['REMOTE_ADDR'];
//}
////echo $ip;
//if($ip == "91.164.180.89" || $ip == "81.251.253.22" || $ip == "197.149.33.40" || $ip == "91.175.47.123" || $ip == "146.247.88.170" || $ip =="154.126.87.131"){
//
//
//}else{
//
//echo '<!doctype html>
//<title>Site Maintenance</title>
//<style>
// body { text-align: center; padding: 150px; }
// h1 { font-size: 50px; }
// body { font: 20px Helvetica, sans-serif; color: #333; }
// article { display: block; text-align: left; width: 650px; margin: 0 auto; }
// a { color: #dc8100; text-decoration: none; }
// a:hover { color: #333; text-decoration: none; }
//</style>
//
//<article>
//
// <h1>Le site est en maintenance </h1>
//
// <div>
// <p> Le site est actuellement en maintenance. Lachouettemauve reviendra aux alentours de 15h30 ! </p>
// <p>— Lachouettemauve</p>
// </div>
//</article>';
//
//exit;
//}
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
}
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);