|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Alpixel\Bundle\UserBundle\DependencyInjection; |
|
4
|
|
|
|
|
5
|
|
|
use Symfony\Component\Config\FileLocator; |
|
6
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
7
|
|
|
use Symfony\Component\DependencyInjection\Loader; |
|
8
|
|
|
use Symfony\Component\HttpKernel\DependencyInjection\Extension; |
|
9
|
|
|
|
|
10
|
|
|
class AlpixelUserExtension extends Extension |
|
11
|
|
|
{ |
|
12
|
|
|
/** |
|
13
|
|
|
* {@inheritdoc} |
|
14
|
|
|
*/ |
|
15
|
|
|
public function load(array $configs, ContainerBuilder $container) |
|
16
|
|
|
{ |
|
17
|
|
|
$configuration = new Configuration(); |
|
18
|
|
|
$config = $this->processConfiguration($configuration, $configs); |
|
19
|
|
|
$this->bindParameters($container, 'alpixel_user', $config); |
|
20
|
|
|
|
|
21
|
|
|
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
22
|
|
|
$loader->load('services.yml'); |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Binds the params from config. |
|
27
|
|
|
* |
|
28
|
|
|
* @param ContainerBuilder $container Containerbuilder |
|
29
|
|
|
* @param string $name Alias name |
|
30
|
|
|
* @param array $config Configuration Array |
|
31
|
|
|
*/ |
|
32
|
|
|
public function bindParameters(ContainerBuilder $container, $name, $config) |
|
|
|
|
|
|
33
|
|
|
{ |
|
34
|
|
|
$container->setParameter('alpixel_user.role_descriptions', $config['role_descriptions']); |
|
35
|
|
|
$container->setParameter('alpixel_user.firewall_templates', $config['firewall_templates']); |
|
36
|
|
|
$container->setParameter('alpixel_user.default_login_background_image', $config['default_login_background_image']); |
|
37
|
|
|
$container->setParameter('alpixel_user.default_login_background_color', $config['default_login_background_color']); |
|
38
|
|
|
} |
|
39
|
|
|
} |
|
40
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.