3 namespace Rapsys\AirBundle\DependencyInjection
;
5 use Symfony\Component\DependencyInjection\ContainerBuilder
;
6 use Symfony\Component\Config\FileLocator
;
7 use Symfony\Component\HttpKernel\DependencyInjection\Extension
;
8 use Symfony\Component\DependencyInjection\Loader
;
11 * This is the class that loads and manages your bundle configuration.
13 * @link http://symfony.com/doc/current/cookbook/bundles/extension.html
15 class RapsysAirExtension
extends Extension
{
19 public function load(array $configs, ContainerBuilder
$container) {
20 $loader = new Loader\
YamlFileLoader($container, new FileLocator('config/packages'));
21 $loader->load($this->getAlias().'.yaml');
23 $configuration = new Configuration();
24 $config = $this->processConfiguration($configuration, $configs);
26 //Set default config in parameter
27 if (!$container->hasParameter($alias = $this->getAlias())) {
28 $container->setParameter($alias, $config[$alias]);
30 $config[$alias] = $container->getParameter($alias);
33 //Transform the one level tree in flat parameters
34 foreach($config[$alias] as $k => $v) {
35 //Set is as parameters
36 $container->setParameter($alias.'.'.$k, $v);
43 public function getAlias() {