-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy pathRulesServiceProvider.php
More file actions
39 lines (33 loc) · 1.24 KB
/
RulesServiceProvider.php
File metadata and controls
39 lines (33 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* @file
* Contains \Drupal\rules\RulesServiceProvider.
*/
namespace Drupal\rules;
use Drupal\Core\Config\BootstrapConfigStorageFactory;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;
use Symfony\Component\DependencyInjection\Reference;
/**
* Defines a service profiler for the WebProfiler module.
*/
class RulesServiceProvider extends ServiceProviderBase {
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
if (FALSE !== $container->hasDefinition('logger.channel.rules') && $container->hasDefinition('webprofiler.drupal')) {
$container->register('webprofiler.rules', 'Drupal\rules\WebProfiler\DataCollector\RulesDataCollector')
->addArgument(new Reference('logger.channel.rules'))
->addTag('data_collector', array(
'template' => '@rules/Collector/rules.html.twig',
'id' => 'rules',
'title' => 'Rules',
'priority' => 200,
));
// Replace the regular logger.channel.rules service with a traceable one.
$definition = $container->findDefinition('logger.channel.rules');
$definition->setClass('Drupal\rules\WebProfiler\RulesChannelLoggerWrapper');
}
}
}