Skip to content

Commit 73bcc91

Browse files
author
Kapitanov Andrey
committed
ECS-365 elastic http client
1 parent 87e433d commit 73bcc91

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ElasticClient.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,13 @@ public static function fromConfig(array $config): static
157157
$builder->setBasicAuthentication($username, $password);
158158
}
159159

160-
if (filled($config['handler'] ?? null)) {
161-
$builder->setHandler(call_user_func_array($config['handler'], []));
160+
if (filled($config['http_client'] ?? null)) {
161+
$httpClient = call_user_func_array($config['http_client'], []);
162+
163+
$client = new $httpClient['class']();
164+
165+
$builder->setHttpClient($client);
166+
$builder->setHttpClientOptions($httpClient['options']);
162167
}
163168

164169
return new static($builder->build());

0 commit comments

Comments
 (0)