bootstrap.php 924 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. declare(strict_types=1);
  3. use Hypervel\Foundation\Testing\TestScanHandler;
  4. ini_set('display_errors', 'on');
  5. ini_set('display_startup_errors', 'on');
  6. error_reporting(E_ALL);
  7. ! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
  8. $dir = __DIR__;
  9. $lastDir = '';
  10. if (! defined('BASE_PATH')) {
  11. while (! file_exists($dir . '/composer.json') && $dir !== dirname($dir)) {
  12. if ($lastDir === $dir) {
  13. break;
  14. }
  15. $lastDir = $dir;
  16. $dir = dirname($dir);
  17. }
  18. }
  19. if (! file_exists($dir . '/composer.json')) {
  20. throw new RuntimeException('Unable to find base path (directory with composer.json)');
  21. }
  22. define('BASE_PATH', $dir);
  23. require BASE_PATH . '/vendor/autoload.php';
  24. Hypervel\Foundation\ClassLoader::init(null, null, new TestScanHandler());
  25. $app = require BASE_PATH . '/bootstrap/app.php';
  26. $app->get(Hyperf\Contract\ApplicationInterface::class);