/** * @param array $arguments */ protected function fetchCommand($arguments) { if (count($arguments) !== 1 && count($arguments) !== 2 && count($arguments) !== 3) { return $this->helpCommand('fetch'); } $controller = new \etobi\extensionUtils\Controller\TerController(); $success = $controller->fetchAction($arguments[0], isset($arguments[1]) ? $arguments[1] : NULL, isset($arguments[2]) ? $arguments[2] : NULL); return $success; }
/** * @param array $arguments * @return bool|void */ protected function fetchCommand($arguments) { if (count($arguments) !== 1 && count($arguments) !== 2 && count($arguments) !== 3 && count($arguments) !== 4) { return $this->helpCommand('fetch'); } $useCurl = false; foreach ($arguments as $key => $value) { if ($value == '--use-curl') { $useCurl = true; unset($arguments[$key]); } } $arguments = array_values($arguments); $controller = new \etobi\extensionUtils\Controller\TerController(); $success = $controller->fetchAction($arguments[0], isset($arguments[1]) ? $arguments[1] : NULL, isset($arguments[2]) ? $arguments[2] : NULL, $useCurl); return $success; }