Skip to content

Commit

Permalink
[HttpClient][HttpClientTrait] add install curl suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
ybenhssaien committed Sep 14, 2020
1 parent 9f8b941 commit 1a17811
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Symfony/Component/HttpClient/HttpClientTrait.php
Expand Up @@ -198,7 +198,13 @@ private static function mergeDefaultOptions(array $options, array $defaultOption
}

if ('auth_ntlm' === $name) {
throw new InvalidArgumentException(sprintf('Option "auth_ntlm" is not supported by "%s", try using "%s" instead.', __CLASS__, CurlHttpClient::class));
if (!\extension_loaded('curl')) {
$helpMsg = 'try installing the "curl" extension to use "' . CurlHttpClient::class . '" instead.';
} else {
$helpMsg = 'try using "'.CurlHttpClient::class.'" instead.';
}

throw new InvalidArgumentException(sprintf('Option "auth_ntlm" is not supported by "%s", %s', __CLASS__, $helpMsg));
}

$alternatives = [];
Expand Down

0 comments on commit 1a17811

Please sign in to comment.