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. echo '';
  20. /*
  21. |--------------------------------------------------------------------------
  22. | Register The Auto Loader
  23. |--------------------------------------------------------------------------
  24. |
  25. | Composer provides a convenient, automatically generated class loader for
  26. | this application. We just need to utilize it! We'll simply require it
  27. | into the script here so we don't need to manually load our classes.
  28. |
  29. */
  30. require __DIR__.'/../vendor/autoload.php';
  31. /*
  32. |--------------------------------------------------------------------------
  33. | Run The Application
  34. |--------------------------------------------------------------------------
  35. |
  36. | Once we have the application, we can handle the incoming request using
  37. | the application's HTTP kernel. Then, we will send the response back
  38. | to this client's browser, allowing them to enjoy our application.
  39. |
  40. */
  41. //图片上传目录
  42. define('DIR_IMAGE',str_replace('\\','/',__DIR__).'/uploads/');
  43. $app = require_once __DIR__.'/../bootstrap/app.php';
  44. $kernel = $app->make(Kernel::class);
  45. $response = tap($kernel->handle(
  46. $request = Request::capture()
  47. ))->send();
  48. $kernel->terminate($request, $response);