index.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. if (!is_dir(__DIR__ . '/../storage/framework/sessions')) {
  28. @mkdir(__DIR__ . '/../storage/framework/sessions', 0755, true);
  29. }
  30. /*
  31. |--------------------------------------------------------------------------
  32. | Register The Auto Loader
  33. |--------------------------------------------------------------------------
  34. |
  35. | Composer provides a convenient, automatically generated class loader for
  36. | this application. We just need to utilize it! We'll simply require it
  37. | into the script here so we don't need to manually load our classes.
  38. |
  39. */
  40. require __DIR__ . '/../vendor/autoload.php';
  41. /*
  42. |--------------------------------------------------------------------------
  43. | Run The Application
  44. |--------------------------------------------------------------------------
  45. |
  46. | Once we have the application, we can handle the incoming request using
  47. | the application's HTTP kernel. Then, we will send the response back
  48. | to this client's browser, allowing them to enjoy our application.
  49. |
  50. */
  51. $app = require_once __DIR__ . '/../bootstrap/app.php';
  52. $kernel = $app->make(Kernel::class);
  53. $response = tap($kernel->handle(
  54. $request = Request::capture()
  55. ))->send();
  56. $kernel->terminate($request, $response);