addCommands([ new DaemonStatusCommand(), new DaemonReloadCommand(), new DaemonStopCommand(), new RunServerCommand(), //运行主服务的指令控制器 new ServerStatusCommand(), new ServerStopCommand(), new ServerReloadCommand(), 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; } /** * @param InputInterface|null $input * @param OutputInterface|null $output * @return int */ public function run(InputInterface $input = null, OutputInterface $output = null): int { try { return parent::run($input, $output); } catch (Exception $e) { die(zm_internal_errcode("E00005") . "{$e->getMessage()} at {$e->getFile()}({$e->getLine()})"); } } }