Skip to content

Commit d0f9be9

Browse files
committed
Fixes
1 parent c8b614c commit d0f9be9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

DependencyInjection/HttplugExtension.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,23 +301,27 @@ private function configureAutoDiscoveryClients(ContainerBuilder $container, arra
301301
if ($httpClient !== null) {
302302
throw new \LogicException('Only one client can configured with "use_with_discovery: http_client".');
303303
}
304-
$httpClient = new Reference('http.client.'.$name);
304+
$httpClient = new Reference('httplug.client.'.$name);
305305
} elseif ($arguments['use_with_discovery'] === 'async_client') {
306306
if ($asyncHttpClient !== null) {
307307
throw new \LogicException('Only one client can be configured with "use_with_discovery: async_client".');
308308
}
309-
$asyncHttpClient = new Reference('http.client.'.$name);
309+
$asyncHttpClient = new Reference('httplug.client.'.$name);
310310
}
311311
}
312312

313313
if ($httpClient === null) {
314314
// Use auto discovery
315-
$asyncHttpClient = $this->registerAutoDiscoverableClientWithDebugPlugin($container, 'client');
315+
if ($config['toolbar']['profile_discovered_client']) {
316+
$httpClient = $this->registerAutoDiscoverableClientWithDebugPlugin($container, 'client');
317+
}
316318
}
317319

318320
if ($asyncHttpClient === null) {
319321
// Use auto discovery
320-
$asyncHttpClient = $this->registerAutoDiscoverableClientWithDebugPlugin($container, 'async_client');
322+
if ($config['toolbar']['profile_discovered_async_client']) {
323+
$asyncHttpClient = $this->registerAutoDiscoverableClientWithDebugPlugin($container, 'async_client');
324+
}
321325
}
322326

323327

0 commit comments

Comments
 (0)