Skip to content

Commit 01ec276

Browse files
stollrnicolas-grekas
authored andcommitted
[FrameworkBundle] Deprecate container parameters router.request_context.scheme and .host
1 parent e01e689 commit 01ec276

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
@@ -33,6 +33,8 @@ FrameworkBundle
3333
---------------
3434

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

3739
HtmlSanitizer
3840
-------------

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ CHANGELOG
88
* Allow using their name without added suffix when using `#[Target]` for custom services
99
* Deprecate `Symfony\Bundle\FrameworkBundle\Console\Application::add()` in favor of `Symfony\Bundle\FrameworkBundle\Console\Application::addCommand()`
1010
* Add `assertEmailAddressNotContains()` to the `MailerAssertionsTrait`
11+
* Deprecate parameters `router.request_context.scheme` and `router.request_context.host`;
12+
use `router.request_context.base_url` or the `framework.router.default_uri` config option instead
1113

1214
7.3
1315
---

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)