annotation-doc 731 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env php
  2. <?php
  3. use EasySwoole\Command\Caller;
  4. use EasySwoole\Command\CommandManager;
  5. use EasySwoole\HttpAnnotation\Utility\DocCommand;
  6. $file = null;
  7. foreach ([ __DIR__ . '/../../../autoload.php', __DIR__ . '/../vendor/autoload.php' ] as $file) {
  8. if (file_exists($file)) {
  9. require $file;
  10. break;
  11. }
  12. }
  13. if(!file_exists($file)){
  14. die("include composer autoload.php fail\n");
  15. }
  16. $command = new DocCommand();
  17. CommandManager::getInstance()->addCommand($command);
  18. array_splice($argv, 1, 0, $command->commandName());
  19. $caller = new Caller();
  20. $caller->setScript(current($argv));
  21. $caller->setCommand(next($argv));
  22. $caller->setParams($argv);
  23. reset($argv);
  24. echo CommandManager::getInstance()->run($caller);