command.stub 436 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace {%namespace%};
  3. use think\console\Command;
  4. use think\console\Input;
  5. use think\console\Output;
  6. class {%className%} extends Command
  7. {
  8. protected function configure()
  9. {
  10. // 指令配置
  11. $this->setName('{%commandName%}');
  12. // 设置参数
  13. }
  14. protected function execute(Input $input, Output $output)
  15. {
  16. // 指令输出
  17. $output->writeln('{%commandName%}');
  18. }
  19. }