Skip to content

Commit 66036ed

Browse files
stollrnicolas-grekas
authored andcommitted
[FrameworkBundle] Deprecate container parameters router.request_context.scheme and .host
1 parent 32b347f commit 66036ed

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

UPGRADE-7.4.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ FrameworkBundle
4343
---------------
4444

4545
* Deprecate `Symfony\Bundle\FrameworkBundle\Console\Application::add()` in favor of `addCommand()`
46+
* Deprecate parameters `router.request_context.scheme` and `router.request_context.host`;
47+
use `router.request_context.base_url` or the `framework.router.default_uri` config option instead
4648

4749
HtmlSanitizer
4850
-------------

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ CHANGELOG
99
* Deprecate `Symfony\Bundle\FrameworkBundle\Console\Application::add()` in favor of `Symfony\Bundle\FrameworkBundle\Console\Application::addCommand()`
1010
* Add `assertEmailAddressNotContains()` to the `MailerAssertionsTrait`
1111
* Add `framework.type_info.aliases` option
12+
* Deprecate parameters `router.request_context.scheme` and `router.request_context.host`;
13+
use `router.request_context.base_url` or the `framework.router.default_uri` config option instead
1214

1315
7.3
1416
---

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,9 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
13071307

13081308
$loader->load('routing.php');
13091309

1310+
$container->deprecateParameter('router.request_context.scheme', 'symfony/framework-bundle', '7.4', 'Parameter "router.request_context.scheme" is deprecated, use "router.request_context.base_url" or the "framework.router.default_uri" config option instead.');
1311+
$container->deprecateParameter('router.request_context.host', 'symfony/framework-bundle', '7.4', 'Parameter "router.request_context.host" is deprecated, use "router.request_context.base_url" or the "framework.router.default_uri" config option instead.');
1312+
13101313
if ($config['utf8']) {
13111314
$container->getDefinition('routing.loader')->replaceArgument(1, ['utf8' => true]);
13121315
}
@@ -1334,8 +1337,7 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
13341337
$container->setParameter('request_listener.https_port', $config['https_port']);
13351338

13361339
if (null !== $config['default_uri']) {
1337-
$container->getDefinition('router.request_context')
1338-
->replaceArgument(0, $config['default_uri']);
1340+
$container->setParameter('router.request_context.base_url', $config['default_uri']);
13391341
}
13401342
}
13411343

0 commit comments

Comments
 (0)