forked from excelwebzone/EWZRecaptchaBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEWZRecaptchaExtension.php
33 lines (28 loc) · 1.18 KB
/
EWZRecaptchaExtension.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
<?php
namespace EWZ\Bundle\RecaptchaBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
* This is the class that loads and manages your bundle configuration
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class EWZRecaptchaExtension extends Extension
{
/**
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$container->setParameter('ewz_recaptcha.public_key', $config['public_key']);
$container->setParameter('ewz_recaptcha.private_key', $config['private_key']);
$container->setParameter('ewz_recaptcha.secure', $config['secure']);
$container->setParameter('ewz_recaptcha.enabled', $config['enabled']);
}
}