-
Notifications
You must be signed in to change notification settings - Fork 3
/
OdsPrometheus.php
39 lines (36 loc) · 1.15 KB
/
OdsPrometheus.php
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
/***************************************************************
* Copyright notice
*
* (c) 2018 Hans Hoechtl <hhoechtl@1drop.de>
* All rights reserved
***************************************************************/
namespace OdsPrometheus;
use OdsPrometheus\Compiler\MetricsCompilerPass;
use Shopware\Components\Plugin;
use Shopware\Components\Plugin\Context\ActivateContext;
use Shopware\Components\Plugin\Context\InstallContext;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class OdsPrometheus extends Plugin
{
/**
* Cache must be cleared to recompile symfony services
*
* @param ActivateContext $context
*/
public function activate(ActivateContext $context)
{
$context->scheduleClearCache(InstallContext::CACHE_LIST_DEFAULT);
}
/**
* Collect all registered services by tag ods_prometheus.metric
* and write them as container parameter array for later iteration.
*
* @param ContainerBuilder $container
*/
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new MetricsCompilerPass());
}
}