Skip to content
Snippets Groups Projects
Commit 72e7f40a authored by Adriano Cori's avatar Adriano Cori Committed by Adriano Cori
Browse files

Issue #2943264 by aronne: Fixed service description loading

parent 9a7d466b
No related branches found
No related tags found
No related merge requests found
......@@ -167,16 +167,18 @@ class HttpClient implements HttpClientInterface {
return $this->getClient();
}
$cmds = $api['commands'];
$config = $api['config'];
// Commands in blacklist or not in whitelist must not use service overrides.
if (
(!empty($cmds['blacklist']) && in_array($commandName, $cmds['blacklist'])) ||
(!empty($cmds['whitelist']) && !in_array($commandName, $cmds['whitelist']))
) {
$this->client = $this->createGuzzleClient($api['orig']['config']);
$config = $api['orig']['config'];
}
return $this->getClient();
$this->client = $this->createGuzzleClient($config);
return $this->client;
}
/**
......@@ -218,16 +220,17 @@ class HttpClient implements HttpClientInterface {
* {@inheritdoc}
*/
protected function loadServiceDescription($config) {
if (empty($this->description)) {
$base_uri = $config['base_uri'];
if (empty($this->description[$base_uri])) {
$source = $this->getApiSourceInfo();
$loader = $this->getFileLoader();
$locator = $this->getFileLocator();
$description = $loader->load($locator->locate($source['basename']));
$description['baseUrl'] = $config['base_uri'];
$this->description = new Description($description);
$description['baseUrl'] = $base_uri;
$this->description[$base_uri] = new Description($description);
}
return $this->description;
return $this->description[$base_uri];
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment