addCommands([ new ServerStatusCommand(), new ServerReloadCommand(), new ServerStopCommand(), new ServerStartCommand(), // 运行主服务的指令控制器 new PureHttpCommand(), // 纯HTTP服务器指令 new SystemdGenerateCommand(), ]); if (LOAD_MODE === 1) { $this->add(new CheckConfigCommand()); } if (Phar::running() === '') { $this->add(new BuildCommand()); $this->add(new InitCommand()); $this->add(new ModulePackCommand()); $this->add(new ModuleListCommand()); $this->add(new ModuleUnpackCommand()); } if (!empty($with_default_cmd)) { $this->setDefaultCommand($with_default_cmd); } return $this; } public function run(InputInterface $input = null, OutputInterface $output = null): int { try { return parent::run($input, $output); } catch (Exception $e) { echo zm_internal_errcode('E00005') . "{$e->getMessage()} at {$e->getFile()}({$e->getLine()})" . PHP_EOL; exit(1); } } }