在某些场景下,我们需要在命令行调用代码首先在applicationcommand目录下新建一个hello.php(没有目录就新建):setName('hello')//配置一个参数并使用$input->getArgument('username')获取//->addArgument('username')//运行“phpthinklist”时的简短描述->setDescription('Certifiedtaskmicroservice.')//使用“--help”选项时的完整命令描述运行命令->setHelp("定时任务微服务没有参数");}/****重写执行**{@inheritdoc}**@paramInput$input*@paramOutput$output*/protectedfunctionexecute(Input$input,Output$output){echo'helloworld';}}修改application/command.php(如果没有创建)
