spc 731 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env php
  2. <?php
  3. use SPC\ConsoleApplication;
  4. use SPC\exception\ExceptionHandler;
  5. if (file_exists(dirname(__DIR__) . '/vendor/autoload.php')) {
  6. // Current: ./bin (git/project mode)
  7. require_once dirname(__DIR__) . '/vendor/autoload.php';
  8. } else {
  9. // Current: ./vendor/crazywhalecc/static-php-cli/bin (composer library mode)
  10. require_once dirname(__DIR__, 3) . '/autoload.php';
  11. }
  12. // 防止 Micro 打包状态下不支持中文的显示(虽然这个项目目前好像没输出过中文?)
  13. if (PHP_OS_FAMILY === 'Windows' && Phar::running()) {
  14. exec('CHCP 65001');
  15. }
  16. try {
  17. (new ConsoleApplication())->run();
  18. } catch (Exception $e) {
  19. ExceptionHandler::getInstance()->handle($e);
  20. exit(1);
  21. }