123456789101112131415161718192021222324252627 |
- #!/usr/bin/env php
- <?php
- use EasySwoole\Command\CommandManager;
- use EasySwoole\Phpunit\PhpunitCommand;
- $file = null;
- foreach ([__DIR__ . '/../../../autoload.php', __DIR__ . '/../vendor/autoload.php'] as $file) {
- if (file_exists($file)) {
- require $file;
- break;
- }
- }
- if (!file_exists($file)) {
- die("include composer autoload.php fail\n");
- }
- $command = new PhpunitCommand();
- CommandManager::getInstance()->addCommand($command);
- array_splice($argv, 1, 0, $command->commandName());
- $caller = new \EasySwoole\Command\Caller();
- $caller->setScript(current($argv));
- $caller->setCommand(next($argv));
- $caller->setParams($argv);
- reset($argv);
- echo CommandManager::getInstance()->run($caller);
|