Skip to content

Commit bdfbd88

Browse files
committed
Do not add stopwatch if already added
1 parent 8bdbee1 commit bdfbd88

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
## UNRELEASED
55

6+
### Added
7+
8+
- The stopwatch plugin in included by default when using profiling.
9+
610
### Changed
711

812
- All clients are registered with the PluginClient. (even in production)

DependencyInjection/HttplugExtension.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,10 @@ private function configureClient(ContainerBuilder $container, $name, array $argu
217217
$pluginClientOptions = [];
218218

219219
if ($profiling) {
220-
// Add the stopwatch plugin
221-
array_unshift($arguments['plugins'], 'httplug.plugin.stopwatch');
220+
if (!in_array('httplug.plugin.stopwatch', $arguments['plugins'])) {
221+
// Add the stopwatch plugin
222+
array_unshift($arguments['plugins'], 'httplug.plugin.stopwatch');
223+
}
222224

223225
// Tell the plugin journal what plugins we used
224226
$container

0 commit comments

Comments
 (0)