From e67ccd6882e4cf0d5ee299a42dcb35de6421a0fa Mon Sep 17 00:00:00 2001 From: devansh bawari Date: Thu, 25 Feb 2021 12:47:02 +0530 Subject: [PATCH] Main Index File Updated --- public/index.php | 55 ++++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/public/index.php b/public/index.php index 128cf2cf5..2b089641b 100644 --- a/public/index.php +++ b/public/index.php @@ -1,5 +1,15 @@ - */ - define('LARAVEL_START', microtime(true)); /* |-------------------------------------------------------------------------- -| Turn On The Lights +| Check If Application Is Under Maintenance |-------------------------------------------------------------------------- | -| We need to illuminate PHP development, so let us turn on the lights. -| This bootstraps the framework and gets it ready for use, then it -| will load up this application so that we can run it and send -| the responses back to the browser and delight our users. +| If the application is maintenance / demo mode via the "down" command we +| will require this file so that any prerendered template can be shown +| instead of starting the framework, which could cause an exception. | */ -$app = require_once __DIR__.'/../bootstrap/app.php'; +if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) { + require __DIR__.'/../storage/framework/maintenance.php'; +} /* |-------------------------------------------------------------------------- | Run The Application |-------------------------------------------------------------------------- | -| Once we have the application, we can handle the incoming request -| through the kernel, and send the associated response back to -| the client's browser allowing them to enjoy the creative -| and wonderful application we have prepared for them. +| Once we have the application, we can handle the incoming request using +| the application's HTTP kernel. Then, we will send the response back +| to this client's browser, allowing them to enjoy our application. | */ +$app = require_once __DIR__.'/../bootstrap/app.php'; + $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); $response = $kernel->handle(