protected function execute(InputInterface $input, OutputInterface $output) { $httpClient = new Client(); $client = new KoalaClient($httpClient); $systems = $client->getSystemsFromUrl($input->getArgument('url'), true); $this->executeSystems($systems, $input->getArgument('exec'), $output, $client); }
protected function execute(InputInterface $input, OutputInterface $output) { $httpClient = new Client(); $client = new KoalaClient($httpClient); $urls = $client->getUrlsFromUrl($input->getArgument('url')); foreach ($urls as $url) { $this->executeCommand($output, str_replace('#url#', $url, $input->getArgument('exec'))); } }
/** * @param Project[] $projects * @param string $command * @param array $translation * @param OutputInterface $output */ protected function executeProjects(array $projects, $command, OutputInterface $output, Client $client, $withSubsystems = false) { foreach ($projects as $project) { $systems = $client->getSystems($project); foreach ($systems as $mainSystem) { if ($withSubsystems) { $systemsWithSubSystems = $mainSystem->getSubSystems(); } else { $systemsWithSubSystems = array(); } $systemsWithSubSystems[] = $mainSystem; $this->executeSystems($systemsWithSubSystems, $command, $output); } } }
protected function execute(InputInterface $input, OutputInterface $output) { $httpClient = new Client(); if ($input->getOption('koalamon_server')) { $client = new KoalaClient($httpClient, $input->getOption('koalamon_server')); } else { $client = new KoalaClient($httpClient); } if ($input->getOption('with-subsystems')) { $withSubsystems = true; } else { $withSubsystems = false; } $projects = $client->getProjects(new User($input->getArgument('username'), $input->getArgument('api_key'))); $this->executeProjects($projects, $input->getArgument('exec'), $output, $client, $withSubsystems); }