-
Notifications
You must be signed in to change notification settings - Fork 1
/
MZagmajsterSentryBundle.php
51 lines (45 loc) · 1.87 KB
/
MZagmajsterSentryBundle.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
40
41
42
43
44
45
46
47
48
49
50
51
<?php
declare(strict_types=1);
namespace MauticPlugin\MZagmajsterSentryBundle;
use BGalati\MonologSentryHandler\SentryHandler;
use BGalati\MonologSentryHandler\SentryHnadler;
use Doctrine\DBAL\Schema\Schema;
use Mautic\CoreBundle\Factory\MauticFactory;
use Mautic\PluginBundle\Bundle\PluginBundleBase;
use Mautic\PluginBundle\Entity\Plugin;
use MauticPlugin\MZagmajsterSentryBundle\DependencyInjection\Compiler\OverrideSentryPass;
use MauticPlugin\MZagmajsterSentryBundle\Sentry\Factory\SentryFactory;
use Sentry\State\Hub;
use Sentry\State\HubInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
class MZagmajsterSentryBundle extends PluginBundleBase
{
public function build(ContainerBuilder $container)
{
$definition = new Definition(HubInterface::class);
$definition->setFactory(
//'MauticPlugin\MZagmajsterSentryBundle\Sentry\Factory\SentryFactory::createHubInstance'
new Reference('mzagmajster.sentry.factory.sentry_factory')
);
$container->setDefinition('sentry.state.hub_interface', $definition);
$definition = new Definition(SentryHandler::class, [
new Reference('sentry.state.hub_interface'),
'%mautic.mzagmajster_sentry_log_level%',
'%mautic.mzagmajster_sentry_log_bubble%',
]);
$container->setDefinition('bgalati.monolog_sentry_handler.sentry_handler', $definition);
}
/**
* Called by PluginController::reloadAction when the plugin version does not match what's installed.
*
* @param null $metadata
* @param Schema $installedSchema
*
* @throws \Exception
*/
public static function onPluginUpdate(Plugin $plugin, MauticFactory $factory, $metadata = null, Schema $installedSchema = null)
{
}
}