artisan 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/usr/bin/env php
  2. <?php
  3. define('LARAVEL_START', microtime(true));
  4. // 避免 phpstorm 刷新命令报错
  5. if (isset($argv[1]) && $argv[1] === '-V') {
  6. die('Symfony version 3.4.21');
  7. }
  8. /*
  9. |--------------------------------------------------------------------------
  10. | Register The Auto Loader
  11. |--------------------------------------------------------------------------
  12. |
  13. | Composer provides a convenient, automatically generated class loader
  14. | for our application. We just need to utilize it! We'll require it
  15. | into the script here so that we do not have to worry about the
  16. | loading of any our classes "manually". Feels great to relax.
  17. |
  18. */
  19. require __DIR__.'/vendor/autoload.php';
  20. $app = require_once __DIR__.'/bootstrap/app.php';
  21. /*
  22. |--------------------------------------------------------------------------
  23. | Run The Artisan Application
  24. |--------------------------------------------------------------------------
  25. |
  26. | When we run the console application, the current CLI command will be
  27. | executed in this console and the response sent back to a terminal
  28. | or another output device for the developers. Here goes nothing!
  29. |
  30. */
  31. $kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
  32. $status = $kernel->handle(
  33. $input = new Symfony\Component\Console\Input\ArgvInput,
  34. new Symfony\Component\Console\Output\ConsoleOutput
  35. );
  36. /*
  37. |--------------------------------------------------------------------------
  38. | Shutdown The Application
  39. |--------------------------------------------------------------------------
  40. |
  41. | Once Artisan has finished running, we will fire off the shutdown events
  42. | so that any final work may be done by the application before we shut
  43. | down the process. This is the last thing to happen to the request.
  44. |
  45. */
  46. $kernel->terminate($input, $status);
  47. exit($status);