作者 李小龙

上传新文件

  1 +<?php
  2 +
  3 +use Illuminate\Contracts\Http\Kernel;
  4 +use Illuminate\Http\Request;
  5 +
  6 +define('LARAVEL_START', microtime(true));
  7 +/*
  8 +|--------------------------------------------------------------------------
  9 +| Check If The Application Is Under Maintenance
  10 +|--------------------------------------------------------------------------
  11 +|
  12 +| If the application is in maintenance / demo mode via the "down" command
  13 +| we will load this file so that any pre-rendered content can be shown
  14 +| instead of starting the framework, which could cause an exception.
  15 +|
  16 +*/
  17 +
  18 +if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
  19 + require $maintenance;
  20 +}
  21 +
  22 +/*
  23 +|--------------------------------------------------------------------------
  24 +| Register The Auto Loader
  25 +|--------------------------------------------------------------------------
  26 +|
  27 +| Composer provides a convenient, automatically generated class loader for
  28 +| this application. We just need to utilize it! We'll simply require it
  29 +| into the script here so we don't need to manually load our classes.
  30 +|
  31 +*/
  32 +
  33 +require __DIR__.'/../vendor/autoload.php';
  34 +
  35 +/*
  36 +|--------------------------------------------------------------------------
  37 +| Run The Application
  38 +|--------------------------------------------------------------------------
  39 +|
  40 +| Once we have the application, we can handle the incoming request using
  41 +| the application's HTTP kernel. Then, we will send the response back
  42 +| to this client's browser, allowing them to enjoy our application.
  43 +|
  44 +*/
  45 +
  46 +$app = require_once __DIR__.'/../bootstrap/app.php';
  47 +
  48 +$kernel = $app->make(Kernel::class);
  49 +
  50 +$response = $kernel->handle(
  51 + $request = Request::capture()
  52 +)->send();
  53 +
  54 +$kernel->terminate($request, $response);