public/index.php line 83

Open in your IDE?
  1. <?php
  2. set_time_limit(0);
  3. ini_set('max_execution_time'0);
  4. error_reporting(E_ALL);
  5. ini_set('display_errors'true);
  6. use App\Kernel;
  7. use Symfony\Component\ErrorHandler\ErrorHandler;
  8. use Symfony\Component\Dotenv\Dotenv;
  9. use Symfony\Component\HttpFoundation\Request;
  10. require __DIR__.'/../vendor/autoload.php';
  11. if(file_exists(__DIR__.'/../maintenance.flag')){
  12.     $protocol 'HTTP/1.0';
  13.     if ( $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.1' ) {
  14.         $protocol 'HTTP/1.1';
  15.     }
  16.     header$protocol ' 503 Service Unavailable'true503 );
  17.     header'Retry-After: 3600' );
  18.     echo '
  19.             <!doctype html>
  20.         <html>
  21.         <head>
  22.         <meta charset="utf-8">
  23.         <title>Shopingy.com | Maintenance</title>
  24.             <style>
  25.                 body {
  26.             background: url("//'$_SERVER['HTTP_HOST'] .'/main.png");
  27.                 background-position-x: 0%;
  28.                 background-position-y: 0%;
  29.                 background-repeat: repeat;
  30.                 background-size: auto;
  31.             background-position: top -101px center;
  32.             background-size: 1920px 1080px;
  33.             background-repeat: no-repeat;
  34.         }     
  35.             </style>
  36.         </head>      
  37.         <body>
  38.         </body>
  39.         </html>
  40.     ';
  41.     exit;
  42. }
  43. // The check is to ensure we don't use .env in production
  44. if (!isset($_SERVER['APP_ENV'])) {
  45.     if (!class_exists(Dotenv::class)) {
  46.         throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
  47.     }
  48.     (new Dotenv())->load(__DIR__.'/../.env');
  49. }
  50. $env $_SERVER['APP_ENV'] ?? 'dev';
  51. $debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env));
  52. //if ($debug) {
  53.     umask(0000);
  54.     //Debug::enable();
  55.     ErrorHandler::register();
  56. //}
  57. if ($trustedProxies $_SERVER['TRUSTED_PROXIES'] ?? false) {
  58.     Request::setTrustedProxies(explode(','$trustedProxies), Request::HEADER_X_FORWARDED_ALL Request::HEADER_X_FORWARDED_HOST);
  59. }
  60. if ($trustedHosts $_SERVER['TRUSTED_HOSTS'] ?? false) {
  61.     Request::setTrustedHosts(explode(','$trustedHosts));
  62. }
  63. $kernel = new Kernel($env$debug);
  64. $request Request::createFromGlobals();
  65. $response $kernel->handle($request);
  66. $response->send();
  67. $kernel->terminate($request$response);