8000 feature #35310 [FrameworkBundle] Deprecate *not* setting the "framewo… · symfony/symfony@fa358e6 · GitHub
[go: up one dir, main page]

Skip to content

Commit fa358e6

Browse files
committed
feature #35310 [FrameworkBundle] Deprecate *not* setting the "framework.router.utf8" option (nicolas-grekas)
This PR was merged into the 5.1-dev branch. Discussion ---------- [FrameworkBundle] Deprecate *not* setting the "framework.router.utf8" option | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | - | License | MIT | Doc PR | - The goal here is to get rid of the `config/packages/routing.yaml` file in Symfony 6. This should have no practical impact as all new apps already define this setting for 2 years. Commits ------- 84849bc [FrameworkBundle] Deprecate *not* setting the "framework.router.utf8" option
2 parents 093c6fe + 84849bc commit fa358e6

File tree

18 files changed

+22
-9
lines changed

18 files changed

+22
-9
lines changed

UPGRADE-5.1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ FrameworkBundle
1010
---------------
1111

1212
* Deprecated passing a `RouteCollectionBuiler` to `MicroKernelTrait::configureRoutes()`, type-hint `RoutingConfigurator` instead
13+
* Deprecated *not* setting the "framework.router.utf8" configuration option as it will default to `true` in Symfony 6.0
1314

1415
HttpFoundation
1516
--------------

UPGRADE-6.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ FrameworkBundle
1010
---------------
1111

1212
* `MicroKernelTrait::configureRoutes()` is now always called with a `RoutingConfigurator`
13+
* The "framework.router.utf8" configuration option defaults to `true`
1314

1415
HttpFoundation
1516
--------------

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CHANGELOG
1010
* Added flex-compatible default implementations for `MicroKernelTrait::registerBundles()` and `getProjectDir()`
1111
* Deprecated passing a `RouteCollectionBuiler` to `MicroKernelTrait::configureRoutes()`, type-hint `RoutingConfigurator` instead
1212
* The `TemplateController` now accepts context argument
13+
* Deprecated *not* setting the "framework.router.utf8" configuration option as it will default to `true` in Symfony 6.0
1314

1415
5.0.0
1516
-----

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ private function addRouterSection(ArrayNodeDefinition $rootNode)
481481
)
482482
->defaultTrue()
483483
->end()
484-
->booleanNode('utf8')->defaultFalse()->end()
484+
->booleanNode('utf8')->defaultNull()->end()
485485
->arrayNode('context')
486486
->info('The request context used to generate URLs in a non-HTTP context')
487487
->addDefaultsIfNotSet()

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,10 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
838838

839839
$loader->load('routing.xml');
840840

841+
if (null === $config['utf8']) {
842+
@trigger_error('Not setting the "framework.router.utf8" configuration option is deprecated since Symfony 5.1, it will default to "true" in Symfony 6.0.', E_USER_DEPRECATED);
843+
}
844+
841845
if ($config['utf8']) {
842846
$container->getDefinition('routing.loader')->replaceArgument(1, ['utf8' => true]);
843847
}

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ protected static function getBundleDefaultConfig()
412412
'http_port' => 80,
413413
'https_port' => 443,
414414
'strict_requirements' => true,
415-
'utf8' => false,
415+
'utf8' => null,
416416
'context' => [
417417
'host' => '%router.request_context.host%',
418418
'scheme' => '%router.request_context.scheme%',

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
'router' => [
2424
'resource' => '%kernel.project_dir%/config/routing.xml',
2525
'type' => 'xml',
26+
'utf8' => true,
2627
],
2728
'session' => [
2829
'storage_id' => 'session.storage.native',

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<framework:esi enabled="true" />
1515
<framework:ssi enabled="true" />
1616
<framework:profiler only-exceptions="true" enabled="false" />
17-
<framework:router resource="%kernel.project_dir%/config/routing.xml" type="xml" />
17+
<framework:router resource="%kernel.project_dir%/config/routing.xml" type="xml" utf8="true" />
1818
<framework:session gc-maxlifetime="90000" gc-probability="1" gc-divisor="108" storage-id="session.storage.native" handler-id="session.handler.native_file" name="_SYMFONY" cookie-lifetime="86400" cookie-path="/" cookie-domain="example.com" cookie-secure="true" cookie-httponly="false" use-cookies="true" save-path="/path/to/sessions" sid-length="22" sid-bits-per-character="4" />
1919
<framework:request>
2020
<framework:format name="csv">

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ framework:
1616
router:
1717
resource: '%kernel.project_dir%/config/routing.xml'
1818
type: xml
19+
utf8: true
1920
session:
2021
storage_id: session.storage.native
2122
handler_id: session.handler.native_file

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/config/framework.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
framework:
22
secret: test
3-
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml" }
3+
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml", utf8: true }
44
validation: { enabled: true, enable_annotations: true }
55
csrf_protection: true
66
form: true

src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/ConcreteMicroKernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
9191
$c->register('logger', NullLogger::class);
9292
$c->loadFromExtension('framework', [
9393
'secret' => '$ecret',
94+
'router' => ['utf8' => true],
9495
]);
9596

9697
$c->setParameter('halloween', 'Have a great day!');

src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/flex-style/src/FlexStyleMicroKernel.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,7 @@ protected function configureContainer(ContainerConfigurator $c)
8181
->set('stdClass', 'stdClass')
8282
->factory([$this, 'createHalloween'])
8383
->arg('$halloween', '%halloween%');
84+
85+
$c->extension('framework', ['router' => ['utf8' => true]]);
8486
}
8587
}

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private function createContainer($sessionStorageOptions)
140140
];
141141

142142
$ext = new FrameworkExtension();
143-
$ext->load(['framework' => ['csrf_protection' => false, 'router' => ['resource' => 'dummy']]], $container);
143+
$ext->load(['framework' => ['csrf_protection' => false, 'router' => ['resource' => 'dummy', 'utf8' => true]]], $container);
144144

145145
$ext = new SecurityExtension();
146146
$ext->load($config, $container);

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Anonymous/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
framework:
22
secret: test
3-
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml" }
3+
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml", utf8: true }
44
validation: { enabled: true, enable_annotations: true }
55
csrf_protection: true
66
form: true

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/FirewallEntryPoint/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
framework:
22
secret: test
3-
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml" }
3+
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml", utf8: true }
44
validation: { enabled: true, enable_annotations: true }
55
csrf_protection: true
66
form: true

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Guarded/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
framework:
22
secret: test
3-
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml" }
3+
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml", utf8: true }
44
test: ~
55
default_locale: en
66
profiler: false

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/config/framework.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
framework:
22
secret: test
3-
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml" }
3+
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml", utf8: true }
44
validation: { enabled: true, enable_annotations: true }
55
assets: ~
66
csrf_protection: true

src/Symfony/Bundle/WebProfilerBundle/Tests/Functional/WebProfilerBundleKernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ protected function configureContainer(ContainerBuilder $containerBuilder, Loader
4343
'secret' => 'foo-secret',
4444
'profiler' => ['only_exceptions' => false],
4545
'session' => ['storage_id' => 'session.storage.mock_file'],
46+
'router' => ['utf8' => true],
4647
]);
4748

4849
$containerBuilder->loadFromExtension('web_profiler', [

0 commit comments

Comments
 (0)
0