Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2a051b5

Browse filesBrowse files
committed
moved DI extensions classes to their own sub-namespace
1 parent 47fd5e8 commit 2a051b5
Copy full SHA for 2a051b5

File tree

Expand file treeCollapse file tree

37 files changed

+318
-320
lines changed
Filter options
Expand file treeCollapse file tree

37 files changed

+318
-320
lines changed

‎src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Symfony\Bundle\DoctrineBundle\DependencyInjection;
44

5-
use Symfony\Components\DependencyInjection\Loader\LoaderExtension;
5+
use Symfony\Components\DependencyInjection\Extension\Extension;
66
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
77
use Symfony\Components\DependencyInjection\ContainerBuilder;
88
use Symfony\Components\DependencyInjection\Definition;
@@ -24,7 +24,7 @@
2424
* @subpackage Bundle_DoctrineBundle
2525
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
2626
*/
27-
class DoctrineExtension extends LoaderExtension
27+
class DoctrineExtension extends Extension
2828
{
2929
protected $resources;
3030
protected $alias;
@@ -59,8 +59,8 @@ public function setAlias($alias)
5959
public function dbalLoad($config, ContainerBuilder $container)
6060
{
6161
if (!$container->hasDefinition('doctrine.dbal.logger')) {
62-
$loader = new XmlFileLoader(__DIR__.'/../Resources/config');
63-
$container->merge($loader->load($this->resources['dbal']));
62+
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
63+
$loader->load($this->resources['dbal']);
6464
}
6565

6666
$defaultConnection = array(
@@ -142,8 +142,8 @@ public function dbalLoad($config, ContainerBuilder $container)
142142
*/
143143
public function ormLoad($config, ContainerBuilder $container)
144144
{
145-
$loader = new XmlFileLoader(__DIR__.'/../Resources/config');
146-
$container->merge($loader->load($this->resources['orm']));
145+
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
146+
$loader->load($this->resources['orm']);
147147

148148
if (isset($config['default_entity_manager'])) {
149149
$container->getParameter('doctrine.orm.default_entity_manager', $config['default_entity_manager']);

‎src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Symfony\Framework\Bundle\Bundle;
66
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface;
7+
use Symfony\Components\DependencyInjection\ContainerBuilder;
78
use Symfony\Components\DependencyInjection\Loader\Loader;
89
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
910
use Symfony\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension;
@@ -36,7 +37,7 @@ class DoctrineBundle extends Bundle
3637
*/
3738
public function buildContainer(ParameterBagInterface $parameterBag)
3839
{
39-
Loader::registerExtension(new DoctrineExtension($parameterBag->get('kernel.bundle_dirs'), $parameterBag->get('kernel.bundles')));
40+
ContainerBuilder::registerExtension(new DoctrineExtension($parameterBag->get('kernel.bundle_dirs'), $parameterBag->get('kernel.bundles')));
4041

4142
$metadataDirs = array();
4243
$entityDirs = array();

‎src/Symfony/Bundle/DoctrineMongoDBBundle/DependencyInjection/MongoDBExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/DoctrineMongoDBBundle/DependencyInjection/MongoDBExtension.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Symfony\Bundle\DoctrineMongoDBBundle\DependencyInjection;
44

5-
use Symfony\Components\DependencyInjection\Loader\LoaderExtension;
5+
use Symfony\Components\DependencyInjection\Extension\Extension;
66
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
77
use Symfony\Components\DependencyInjection\ContainerBuilder;
88
use Symfony\Components\DependencyInjection\Reference;
@@ -18,7 +18,7 @@
1818
*
1919
* @todo Add support for multiple document managers
2020
*/
21-
class MongoDBExtension extends LoaderExtension
21+
class MongoDBExtension extends Extension
2222
{
2323
protected $bundles;
2424
protected $resources = array(
@@ -38,8 +38,8 @@ public function __construct(array $bundles)
3838
*/
3939
public function mongodbLoad($config, ContainerBuilder $container)
4040
{
41-
$loader = new XmlFileLoader(__DIR__.'/../Resources/config');
42-
$container->merge($loader->load($this->resources['mongodb']));
41+
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
42+
$loader->load($this->resources['mongodb']);
4343

4444
if (!$container->hasDefinition('doctrine.odm.mongodb.document_manager')) {
4545

‎src/Symfony/Bundle/DoctrineMongoDBBundle/DoctrineMongoDBBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/DoctrineMongoDBBundle/DoctrineMongoDBBundle.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ class DoctrineMongoDBBundle extends Bundle
2525
*/
2626
public function buildContainer(ParameterBagInterface $parameterBag)
2727
{
28-
Loader::registerExtension(new MongoDBExtension($parameterBag->get('kernel.bundles')));
28+
ContainerBuilder::registerExtension(new MongoDBExtension($parameterBag->get('kernel.bundles')));
2929
}
3030
}

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/WebExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/WebExtension.php
+13-13Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
44

5-
use Symfony\Components\DependencyInjection\Loader\LoaderExtension;
5+
use Symfony\Components\DependencyInjection\Extension\Extension;
66
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
77
use Symfony\Components\DependencyInjection\Resource\FileResource;
88
use Symfony\Components\DependencyInjection\ContainerBuilder;
@@ -25,7 +25,7 @@
2525
* @subpackage Bundle_FrameworkBundle
2626
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
2727
*/
28-
class WebExtension extends LoaderExtension
28+
class WebExtension extends Extension
2929
{
3030
protected $resources = array(
3131
'templating' => 'templating.xml',
@@ -53,8 +53,8 @@ public function __construct(array $bundleDirs, array $bundles)
5353
public function configLoad($config, ContainerBuilder $container)
5454
{
5555
if (!$container->hasDefinition('controller_manager')) {
56-
$loader = new XmlFileLoader(__DIR__.'/../Resources/config');
57-
$container->merge($loader->load($this->resources['web']));
56+
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
57+
$loader->load($this->resources['web']);
5858
}
5959

6060
if (isset($config['ide']) && 'textmate' === $config['ide']) {
@@ -68,9 +68,9 @@ public function configLoad($config, ContainerBuilder $container)
6868
if (isset($config['profiler'])) {
6969
if ($config['profiler']) {
7070
if (!$container->hasDefinition('profiler')) {
71-
$loader = new XmlFileLoader(__DIR__.'/../Resources/config');
72-
$container->merge($loader->load('profiling.xml'));
73-
$container->merge($loader->load('collectors.xml'));
71+
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
72+
$loader->load('profiling.xml');
73+
$loader->load('collectors.xml');
7474
}
7575
} elseif ($container->hasDefinition('profiler')) {
7676
$container->getDefinition('profiling')->clearAnnotations();
@@ -81,8 +81,8 @@ public function configLoad($config, ContainerBuilder $container)
8181
if (isset($config['toolbar'])) {
8282
if ($config['toolbar']) {
8383
if (!$container->hasDefinition('debug.toolbar')) {
84-
$loader = new XmlFileLoader(__DIR__.'/../Resources/config');
85-
$container->merge($loader->load('toolbar.xml'));
84+
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
85+
$loader->load('toolbar.xml');
8686
}
8787
} elseif ($container->hasDefinition('debug.toolbar')) {
8888
$container->getDefinition('debug.toolbar')->clearAnnotations();
@@ -92,8 +92,8 @@ public function configLoad($config, ContainerBuilder $container)
9292
if (isset($config['validation']['enabled'])) {
9393
if ($config['validation']['enabled']) {
9494
if (!$container->hasDefinition('validator')) {
95-
$loader = new XmlFileLoader(__DIR__.'/../Resources/config');
96-
$container->merge($loader->load($this->resources['validation']));
95+
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
96+
$loader->load($this->resources['validation']);
9797
}
9898

9999
$xmlMappingFiles = array();
@@ -175,8 +175,8 @@ public function configLoad($config, ContainerBuilder $container)
175175
public function templatingLoad($config, ContainerBuilder $container)
176176
{
177177
if (!$container->hasDefinition('templating')) {
178-
$loader = new XmlFileLoader(__DIR__.'/../Resources/config');
179-
$container->merge($loader->load($this->resources['templating']));
178+
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
179+
$loader->load($this->resources['templating']);
180180
}
181181

182182
if (array_key_exists('escaping', $config)) {

‎src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class FrameworkBundle extends Bundle
3636
*/
3737
public function buildContainer(ParameterBagInterface $parameterBag)
3838
{
39-
Loader::registerExtension(new WebExtension($parameterBag->get('kernel.bundle_dirs'), $parameterBag->get('kernel.bundles')));
39+
ContainerBuilder::registerExtension(new WebExtension($parameterBag->get('kernel.bundle_dirs'), $parameterBag->get('kernel.bundles')));
4040

4141
$dirs = array('%kernel.root_dir%/views/%%bundle%%/%%controller%%/%%name%%%%format%%.%%renderer%%');
4242
foreach ($parameterBag->get('kernel.bundle_dirs') as $dir) {
@@ -46,8 +46,8 @@ public function buildContainer(ParameterBagInterface $parameterBag)
4646

4747
$container = new ContainerBuilder();
4848
if ($parameterBag->get('kernel.debug')) {
49-
$loader = new XmlFileLoader(__DIR__.'/Resources/config');
50-
$container->merge($loader->load('debug.xml'));
49+
$loader = new XmlFileLoader($container, __DIR__.'/Resources/config');
50+
$loader->load('debug.xml');
5151
}
5252

5353
return $container;

‎src/Symfony/Bundle/PropelBundle/DependencyInjection/PropelExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/PropelBundle/DependencyInjection/PropelExtension.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
namespace Symfony\Bundle\PropelBundle\DependencyInjection;
44

5-
use Symfony\Components\DependencyInjection\Loader\LoaderExtension;
5+
use Symfony\Components\DependencyInjection\Extension\Extension;
66
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
77
use Symfony\Components\DependencyInjection\ContainerBuilder;
88
use Symfony\Components\DependencyInjection\Definition;
99
use Symfony\Components\DependencyInjection\Reference;
1010

11-
class PropelExtension extends LoaderExtension
11+
class PropelExtension extends Extension
1212
{
1313
protected $resources = array(
1414
'propel' => 'propel.xml',
@@ -23,8 +23,8 @@ class PropelExtension extends LoaderExtension
2323
public function configLoad($config, ContainerBuilder $container)
2424
{
2525
if (!$container->hasDefinition('propel')) {
26-
$loader = new XmlFileLoader(__DIR__.'/../Resources/config');
27-
$container->merge($loader->load($this->resources['propel']));
26+
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
27+
$loader->load($this->resources['propel']);
2828
}
2929

3030
if (!$container->hasParameter('propel.path')) {
@@ -53,8 +53,8 @@ public function configLoad($config, ContainerBuilder $container)
5353
public function dbalLoad($config, ContainerBuilder $container)
5454
{
5555
if (!$container->hasDefinition('propel')) {
56-
$loader = new XmlFileLoader(__DIR__.'/../Resources/config');
57-
$container->merge($loader->load($this->resources['propel']));
56+
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
57+
$loader->load($this->resources['propel']);
5858
}
5959

6060
$defaultConnection = array(

‎src/Symfony/Bundle/PropelBundle/PropelBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/PropelBundle/PropelBundle.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class PropelBundle extends Bundle
2020
*/
2121
public function buildContainer(ParameterBagInterface $parameterBag)
2222
{
23-
Loader::registerExtension(new PropelExtension());
23+
ContainerBuilder::registerExtension(new PropelExtension());
2424
}
2525

2626
public function boot(ContainerInterface $container)

‎src/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/SwiftmailerExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SwiftmailerBundle/DependencyInjection/SwiftmailerExtension.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Symfony\Bundle\SwiftmailerBundle\DependencyInjection;
44

5-
use Symfony\Components\DependencyInjection\Loader\LoaderExtension;
5+
use Symfony\Components\DependencyInjection\Extension\Extension;
66
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
77
use Symfony\Components\DependencyInjection\ContainerBuilder;
88
use Symfony\Components\DependencyInjection\Reference;
@@ -23,7 +23,7 @@
2323
* @subpackage Bundle_SwiftmailerBundle
2424
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
2525
*/
26-
class SwiftMailerExtension extends LoaderExtension
26+
class SwiftMailerExtension extends Extension
2727
{
2828
protected $resources = array(
2929
'mailer' => 'swiftmailer.xml',
@@ -46,8 +46,8 @@ class SwiftMailerExtension extends LoaderExtension
4646
public function mailerLoad($config, ContainerBuilder $container)
4747
{
4848
if (!$container->hasDefinition('swiftmailer.mailer')) {
49-
$loader = new XmlFileLoader(__DIR__.'/../Resources/config');
50-
$container->merge($loader->load($this->resources['mailer']));
49+
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
50+
$loader->load($this->resources['mailer']);
5151
$container->setAlias('mailer', 'swiftmailer.mailer');
5252
}
5353

‎src/Symfony/Bundle/SwiftmailerBundle/SwiftmailerBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SwiftmailerBundle/SwiftmailerBundle.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Symfony\Framework\Bundle\Bundle;
66
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface;
7+
use Symfony\Components\DependencyInjection\ContainerBuilder;
78
use Symfony\Components\DependencyInjection\Loader\Loader;
89
use Symfony\Bundle\SwiftmailerBundle\DependencyInjection\SwiftmailerExtension;
910

@@ -34,6 +35,6 @@ class SwiftmailerBundle extends Bundle
3435
*/
3536
public function buildContainer(ParameterBagInterface $parameterBag)
3637
{
37-
Loader::registerExtension(new SwiftmailerExtension());
38+
ContainerBuilder::registerExtension(new SwiftmailerExtension());
3839
}
3940
}

‎src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Symfony\Bundle\TwigBundle\DependencyInjection;
44

5-
use Symfony\Components\DependencyInjection\Loader\LoaderExtension;
5+
use Symfony\Components\DependencyInjection\Extension\Extension;
66
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
77
use Symfony\Components\DependencyInjection\ContainerBuilder;
88

@@ -22,7 +22,7 @@
2222
* @subpackage Bundle_TwigBundle
2323
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
2424
*/
25-
class TwigExtension extends LoaderExtension
25+
class TwigExtension extends Extension
2626
{
2727
/**
2828
* Loads the Twig configuration.
@@ -33,8 +33,8 @@ class TwigExtension extends LoaderExtension
3333
public function configLoad($config, ContainerBuilder $container)
3434
{
3535
if (!$container->hasDefinition('twig')) {
36-
$loader = new XmlFileLoader(__DIR__.'/../Resources/config');
37-
$container->merge($loader->load('twig.xml'));
36+
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
37+
$loader->load('twig.xml');
3838
}
3939

4040
$container->setParameter('twig.options', array_replace($container->getParameter('twig.options'), $config));

‎src/Symfony/Bundle/TwigBundle/TwigBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/TwigBundle.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ class TwigBundle extends Bundle
3636
*/
3737
public function buildContainer(ParameterBagInterface $parameterBag)
3838
{
39-
Loader::registerExtension(new TwigExtension());
39+
ContainerBuilder::registerExtension(new TwigExtension());
4040
}
4141
}

‎src/Symfony/Bundle/ZendBundle/DependencyInjection/ZendExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/ZendBundle/DependencyInjection/ZendExtension.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Symfony\Bundle\ZendBundle\DependencyInjection;
44

5-
use Symfony\Components\DependencyInjection\Loader\LoaderExtension;
5+
use Symfony\Components\DependencyInjection\Extension\Extension;
66
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
77
use Symfony\Components\DependencyInjection\ContainerBuilder;
88

@@ -22,7 +22,7 @@
2222
* @subpackage Bundle_ZendBundle
2323
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
2424
*/
25-
class ZendExtension extends LoaderExtension
25+
class ZendExtension extends Extension
2626
{
2727
protected $resources = array(
2828
'logger' => 'logger.xml',
@@ -41,8 +41,8 @@ class ZendExtension extends LoaderExtension
4141
public function loggerLoad($config, ContainerBuilder $container)
4242
{
4343
if (!$container->hasDefinition('zend.logger')) {
44-
$loader = new XmlFileLoader(__DIR__.'/../Resources/config');
45-
$container->merge($loader->load($this->resources['logger']));
44+
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
45+
$loader->load($this->resources['logger']);
4646
$container->setAlias('logger', 'zend.logger');
4747
}
4848

‎src/Symfony/Bundle/ZendBundle/ZendBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/ZendBundle/ZendBundle.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface;
77
use Symfony\Components\DependencyInjection\Reference;
88
use Symfony\Components\DependencyInjection\Loader\Loader;
9+
use Symfony\Components\DependencyInjection\ContainerBuilder;
910
use Symfony\Bundle\ZendBundle\DependencyInjection\ZendExtension;
1011

1112
/*
@@ -35,6 +36,6 @@ class ZendBundle extends Bundle
3536
*/
3637
public function buildContainer(ParameterBagInterface $parameterBag)
3738
{
38-
Loader::registerExtension(new ZendExtension());
39+
ContainerBuilder::registerExtension(new ZendExtension());
3940
}
4041
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.