index.php 2.3 KB

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