artisan 2.0 KB

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