index.php 1.9 KB

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