-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapbenderLDAPBundle.php
28 lines (25 loc) · 1.01 KB
/
MapbenderLDAPBundle.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
<?php
namespace Mapbender\LDAPBundle;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Ldap\Adapter\ExtLdap\Adapter;
use Symfony\Component\DependencyInjection\Definition;
class MapbenderLDAPBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
$configLocator = new FileLocator(__DIR__ . '/Resources/config');
$loader = new YamlFileLoader($container, $configLocator);
$loader->load('services.yml');
$providerDefinition = new Definition(Adapter::class, array([
'host' => '%ldap.host%',
'port' => '%ldap.port%',
'version' => '%ldap.version%',
'encryption' => '%ldap.encryption%',
],
));
$container->setDefinition('Symfony\Component\Ldap\Adapter\ExtLdap\Adapter', $providerDefinition);
}
}