vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/DependencyInjection/DoctrineMigrationsExtension.php
changeset 39 03b14b0fe101
equal deleted inserted replaced
38:bbdc7f9aa25e 39:03b14b0fe101
       
     1 <?php
       
     2 
       
     3 /*
       
     4  * This file is part of the Symfony package.
       
     5  *
       
     6  * (c) Fabien Potencier <fabien@symfony.com>
       
     7  *
       
     8  * For the full copyright and license information, please view the LICENSE
       
     9  * file that was distributed with this source code.
       
    10  */
       
    11 
       
    12 namespace Symfony\Bundle\DoctrineMigrationsBundle\DependencyInjection;
       
    13 
       
    14 use Symfony\Component\Config\Definition\Processor;
       
    15 use Symfony\Component\DependencyInjection\ContainerBuilder;
       
    16 use Symfony\Component\HttpKernel\DependencyInjection\Extension;
       
    17 
       
    18 /**
       
    19  * DoctrineMigrationsExtension.
       
    20  *
       
    21  * @author Lukas Kahwe Smith <smith@pooteeweet.org>
       
    22  */
       
    23 class DoctrineMigrationsExtension extends Extension
       
    24 {
       
    25     /**
       
    26      * Responds to the twig configuration parameter.
       
    27      *
       
    28      * @param array            $configs
       
    29      * @param ContainerBuilder $container
       
    30      */
       
    31     public function load(array $configs, ContainerBuilder $container)
       
    32     {
       
    33         $processor = new Processor();
       
    34         $configuration = new Configuration();
       
    35 
       
    36         $config = $processor->process($configuration->getConfigTree(), $configs);
       
    37 
       
    38         foreach ($config as $key => $value) {
       
    39             $container->setParameter($this->getAlias().'.'.$key, $value);
       
    40         }
       
    41     }
       
    42 
       
    43     /**
       
    44      * Returns the base path for the XSD files.
       
    45      *
       
    46      * @return string The XSD base path
       
    47      */
       
    48     public function getXsdValidationBasePath()
       
    49     {
       
    50         return __DIR__.'/../Resources/config/schema';
       
    51     }
       
    52 
       
    53     public function getNamespace()
       
    54     {
       
    55         return 'http://symfony.com/schema/dic/doctrine/migrations';
       
    56     }
       
    57 }