addCommands([ new RunServerCommand(), //运行主服务的指令控制器 new InitCommand() //初始化用的,用于项目初始化和phar初始化 ]); if (LOAD_MODE === 0) $this->add(new BuildCommand()); //只有在git源码模式才能使用打包指令 } /** * @param InputInterface|null $input * @param OutputInterface|null $output * @return int */ public function run(InputInterface $input = null, OutputInterface $output = null) { try { return parent::run($input, $output); } catch (Exception $e) { die("{$e->getMessage()} at {$e->getFile()}({$e->getLine()})"); } } }