Skip to content

Commit 422c878

Browse files
committed
[Workflow] Add a profiler
1 parent 704d0be commit 422c878

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ public function load(array $configs, ContainerBuilder $container)
280280
$this->readConfigEnabled('translator', $container, $config['translator']);
281281
$this->readConfigEnabled('property_access', $container, $config['property_access']);
282282
$this->readConfigEnabled('profiler', $container, $config['profiler']);
283+
$this->readConfigEnabled('workflows', $container, $config['workflows']);
283284

284285
// A translator must always be registered (as support is included by
285286
// default in the Form and Validator component). If disabled, an identity
@@ -876,6 +877,10 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
876877
$loader->load('mailer_debug.php');
877878
}
878879

880+
if ($this->isInitializedConfigEnabled('workflows')) {
881+
$loader->load('workflow_debug.php');
882+
}
883+
879884
if ($this->isInitializedConfigEnabled('http_client')) {
880885
$loader->load('http_client_debug.php');
881886
}

Resources/config/workflow_debug.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
13+
14+
use Symfony\Component\Workflow\DataCollector\WorkflowDataCollector;
15+
16+
return static function (ContainerConfigurator $container) {
17+
$container->services()
18+
->set('data_collector.workflow', WorkflowDataCollector::class)
19+
->tag('data_collector', [
20+
'template' => '@WebProfiler/Collector/workflow.html.twig',
21+
'id' => 'workflow',
22+
])
23+
->args([
24+
tagged_iterator('workflow', 'name'),
25+
])
26+
;
27+
};

0 commit comments

Comments
 (0)