index.php 2.2 KB

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