forked from mautic/mautic
/
MauticApiBundle.php
46 lines (39 loc) · 1.08 KB
/
MauticApiBundle.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
<?php
/*
* @copyright 2014 Mautic Contributors. All rights reserved
* @author Mautic
*
* @link http://mautic.org
*
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
namespace Mautic\ApiBundle;
use Mautic\ApiBundle\DependencyInjection\Compiler\OAuthPass;
use Mautic\ApiBundle\DependencyInjection\Compiler\SerializerPass;
use Mautic\ApiBundle\DependencyInjection\Factory\ApiFactory;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* Class MauticApiBundle.
*/
class MauticApiBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new OAuthPass());
$container->addCompilerPass(new SerializerPass());
$extension = $container->getExtension('security');
$extension->addSecurityListenerFactory(new ApiFactory());
}
/**
* {@inheritdoc}
*/
public function getParent()
{
return 'FOSOAuthServerBundle';
}
}