Skip to content

Commit af1f030

Browse files
[DependencyInjection][Routing] Remove support for the XML configuration format
1 parent 16c6c07 commit af1f030

File tree

319 files changed

+7
-10998
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

319 files changed

+7
-10998
lines changed

src/Symfony/Bundle/DebugBundle/Resources/config/schema/debug-1.0.xsd

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Command/BuildDebugContainerTrait.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Command;
1313

1414
use Symfony\Component\Config\ConfigCache;
15-
use Symfony\Component\Config\FileLocator;
16-
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
1715
use Symfony\Component\DependencyInjection\ContainerBuilder;
18-
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
1916
use Symfony\Component\HttpKernel\KernelInterface;
2017

2118
/**
@@ -60,16 +57,10 @@ protected function getContainerBuilder(KernelInterface $kernel): ContainerBuilde
6057
}, $kernel, $kernel::class);
6158
$container = $buildContainer();
6259

63-
if (str_ends_with($file, '.xml') && is_file(substr_replace($file, '.ser', -4))) {
64-
$dumpedContainer = unserialize(file_get_contents(substr_replace($file, '.ser', -4)));
65-
$container->setDefinitions($dumpedContainer->getDefinitions());
66-
$container->setAliases($dumpedContainer->getAliases());
67-
$container->__construct($dumpedContainer->getParameterBag());
68-
} else {
69-
(new XmlFileLoader($container, new FileLocator()))->load($file);
70-
$locatorPass = new ServiceLocatorTagPass();
71-
$locatorPass->process($container);
72-
}
60+
$dumpedContainer = unserialize(file_get_contents(substr_replace($file, '.ser', -4)));
61+
$container->setDefinitions($dumpedContainer->getDefinitions());
62+
$container->setAliases($dumpedContainer->getAliases());
63+
$container->__construct($dumpedContainer->getParameterBag());
7364
}
7465

7566
return $this->container = $container;

src/Symfony/Bundle/FrameworkBundle/Command/ContainerLintCommand.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Command;
1313

1414
use Symfony\Component\Config\ConfigCache;
15-
use Symfony\Component\Config\FileLocator;
1615
use Symfony\Component\Console\Attribute\AsCommand;
1716
use Symfony\Component\Console\Command\Command;
1817
use Symfony\Component\Console\Exception\RuntimeException;
@@ -27,8 +26,6 @@
2726
use Symfony\Component\DependencyInjection\Compiler\ResolveParameterPlaceHoldersPass;
2827
use Symfony\Component\DependencyInjection\ContainerBuilder;
2928
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
30-
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
31-
use Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag;
3229
use Symfony\Component\HttpKernel\Kernel;
3330

3431
#[AsCommand(name: 'lint:container', description: 'Ensure that arguments injected into services match type declarations')]
@@ -96,11 +93,7 @@ private function getContainerBuilder(bool $resolveEnvVars): ContainerBuilder
9693
}, $kernel, $kernel::class);
9794
$container = $buildContainer();
9895
} else {
99-
if (str_ends_with($file, '.xml') && is_file(substr_replace($file, '.ser', -4))) {
100-
$container = unserialize(file_get_contents(substr_replace($file, '.ser', -4)));
101-
} else {
102-
(new XmlFileLoader($container = new ContainerBuilder(new EnvPlaceholderParameterBag()), new FileLocator()))->load($file);
103-
}
96+
$container = unserialize(file_get_contents(substr_replace($file, '.ser', -4)));
10497

10598
if (!$container instanceof ContainerBuilder) {
10699
throw new RuntimeException(\sprintf('This command does not support the application container: "%s" is not a "%s".', get_debug_type($container), ContainerBuilder::class));

src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
use Symfony\Component\Routing\Loader\GlobFileLoader;
3333
use Symfony\Component\Routing\Loader\PhpFileLoader;
3434
use Symfony\Component\Routing\Loader\Psr4DirectoryLoader;
35-
use Symfony\Component\Routing\Loader\XmlFileLoader;
3635
use Symfony\Component\Routing\Loader\YamlFileLoader;
3736
use Symfony\Component\Routing\Matcher\Dumper\CompiledUrlMatcherDumper;
3837
use Symfony\Component\Routing\Matcher\ExpressionLanguageProvider;
@@ -51,13 +50,6 @@
5150
$container->services()
5251
->set('routing.resolver', LoaderResolver::class)
5352

54-
->set('routing.loader.xml', XmlFileLoader::class)
55-
->args([
56-
service('file_locator'),
57-
'%kernel.environment%',
58-
])
59-
->tag('routing.loader')
60-
6153
->set('routing.loader.yml', YamlFileLoader::class)
6254
->args([
6355
service('file_locator'),

0 commit comments

Comments
 (0)