bootstrap.php 828 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. use Illuminate\Contracts\Console\Kernel;
  3. require_once __DIR__.'/../vendor/autoload.php';
  4. if (file_exists($_SERVER['APP_CONFIG_CACHE'])) {
  5. unlink($_SERVER['APP_CONFIG_CACHE']);
  6. }
  7. /*
  8. |--------------------------------------------------------------------------
  9. | Bootstrap The Test Environment
  10. |--------------------------------------------------------------------------
  11. |
  12. | You may specify console commands that execute once before your test is
  13. | run. You are free to add your own additional commands or logic into
  14. | this file as needed in order to help your test suite run quicker.
  15. |
  16. */
  17. $commands = [
  18. 'config:cache',
  19. 'event:cache',
  20. ];
  21. $app = require __DIR__.'/../bootstrap/app.php';
  22. $console = tap($app->make(Kernel::class))->bootstrap();
  23. foreach ($commands as $command) {
  24. $console->call($command);
  25. }