forked from lolautruche/EzCoreExtraBundle
/
SecurityPass.php
29 lines (24 loc) · 1.02 KB
/
SecurityPass.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
<?php
/*
* This file is part of the EzCoreExtraBundle package.
*
* @copyright Jérôme Vieilledent <jerome@vieilledent.fr>
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Lolautruche\EzCoreExtraBundle\DependencyInjection\Compiler;
use Lolautruche\EzCoreExtraBundle\Security\RepositoryAuthenticationProvider;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
class SecurityPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('security.authentication.provider.dao')) {
return;
}
$container->findDefinition('security.authentication.provider.dao')
->setClass(RepositoryAuthenticationProvider::class)
->addMethodCall('setConfigResolver', [new Reference('ezpublish.config.resolver')]);
}
}