diff --git a/UPGRADE-7.4.md b/UPGRADE-7.4.md index ff4dde989237d..49cd6c743a74b 100644 --- a/UPGRADE-7.4.md +++ b/UPGRADE-7.4.md @@ -33,6 +33,8 @@ FrameworkBundle --------------- * Deprecate `Symfony\Bundle\FrameworkBundle\Console\Application::add()` in favor of `addCommand()` + * Deprecate parameters `router.request_context.scheme` and `router.request_context.host`; + use `router.request_context.base_url` or the `framework.router.default_uri` config option instead HtmlSanitizer ------------- diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index 76b3cb9479256..addeffc7c892c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -8,6 +8,8 @@ CHANGELOG * Allow using their name without added suffix when using `#[Target]` for custom services * Deprecate `Symfony\Bundle\FrameworkBundle\Console\Application::add()` in favor of `Symfony\Bundle\FrameworkBundle\Console\Application::addCommand()` * Add `assertEmailAddressNotContains()` to the `MailerAssertionsTrait` + * Deprecate parameters `router.request_context.scheme` and `router.request_context.host`; + use `router.request_context.base_url` or the `framework.router.default_uri` config option instead 7.3 --- diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index e21b8b838c13e..cc801a2eff246 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -1307,6 +1307,9 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co $loader->load('routing.php'); + $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.'); + $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.'); + if ($config['utf8']) { $container->getDefinition('routing.loader')->replaceArgument(1, ['utf8' => true]); } @@ -1334,8 +1337,7 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co $container->setParameter('request_listener.https_port', $config['https_port']); if (null !== $config['default_uri']) { - $container->getDefinition('router.request_context') - ->replaceArgument(0, $config['default_uri']); + $container->setParameter('router.request_context.base_url', $config['default_uri']); } }