-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUxGoodOAuthBundle.php
More file actions
39 lines (33 loc) · 1.2 KB
/
Copy pathUxGoodOAuthBundle.php
File metadata and controls
39 lines (33 loc) · 1.2 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
namespace UxGood\Bundle\OAuthBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use UxGood\Bundle\OAuthBundle\DependencyInjection\UxGoodOAuthExtension;
use UxGood\Bundle\OAuthBundle\DependencyInjection\Security\Factory\OAuthFactory;
use UxGood\Bundle\OAuthBundle\DependencyInjection\Security\UserProvider\OAuthFactory as OAuthUserProviderFactory;
class UxGoodOAuthBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $container)
{
parent::build($container);
/** @var $extension SecurityExtension */
$extension = $container->getExtension('security');
$extension->addSecurityListenerFactory(new OAuthFactory());
$extension->addUserProviderFactory(new OAuthUserProviderFactory());
}
/**
* {@inheritdoc}
*/
public function getContainerExtension()
{
// return the right extension instead of "auto-registering" it. Now the
// alias can be uxgood_oauth instead of ux_good_o_auth..
if (null === $this->extension) {
return new UxGoodOAuthExtension();
}
return $this->extension;
}
}