Skip to content
Permalink
Browse files

[FrameworkBundle] Deprecate *not* setting the "framework.router.utf8"…

… option
  • Loading branch information
nicolas-grekas committed Jan 11, 2020
1 parent 37a8863 commit 84849bc96a24a3a91ea30817f11504c62c00f275
Showing with 22 additions and 9 deletions.
  1. +1 −0 UPGRADE-5.1.md
  2. +1 −0 UPGRADE-6.0.md
  3. +1 −0 src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
  4. +1 −1 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
  5. +4 −0 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
  6. +1 −1 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
  7. +1 −0 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php
  8. +1 −1 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml
  9. +1 −0 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml
  10. +1 −1 src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/config/framework.yml
  11. +1 −0 src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/ConcreteMicroKernel.php
  12. +2 −0 src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/flex-style/src/FlexStyleMicroKernel.php
  13. +1 −1 ...y/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php
  14. +1 −1 src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Anonymous/config.yml
  15. +1 −1 src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/FirewallEntryPoint/config.yml
  16. +1 −1 src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Guarded/config.yml
  17. +1 −1 src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/config/framework.yml
  18. +1 −0 src/Symfony/Bundle/WebProfilerBundle/Tests/Functional/WebProfilerBundleKernel.php
@@ -10,6 +10,7 @@ FrameworkBundle
---------------

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

HttpFoundation
--------------
@@ -10,6 +10,7 @@ FrameworkBundle
---------------

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

HttpFoundation
--------------
@@ -9,6 +9,7 @@ CHANGELOG
* Added flex-compatible default implementations for `MicroKernelTrait::registerBundles()` and `getProjectDir()`
* Deprecated passing a `RouteCollectionBuiler` to `MicroKernelTrait::configureRoutes()`, type-hint `RoutingConfigurator` instead
* The `TemplateController` now accepts context argument
* Deprecated *not* setting the "framework.router.utf8" configuration option as it will default to `true` in Symfony 6.0

5.0.0
-----
@@ -481,7 +481,7 @@ private function addRouterSection(ArrayNodeDefinition $rootNode)
)
->defaultTrue()
->end()
->booleanNode('utf8')->defaultFalse()->end()
->booleanNode('utf8')->defaultNull()->end()
->arrayNode('context')
->info('router request context')
->addDefaultsIfNotSet()
@@ -838,6 +838,10 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co

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

if (null === $config['utf8']) {
@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);
}

if ($config['utf8']) {
$container->getDefinition('routing.loader')->replaceArgument(1, ['utf8' => true]);
}
@@ -412,7 +412,7 @@ protected static function getBundleDefaultConfig()
'http_port' => 80,
'https_port' => 443,
'strict_requirements' => true,
'utf8' => false,
'utf8' => null,
'context' => [
'host' => '%router.request_context.host%',
'scheme' => '%router.request_context.scheme%',
@@ -23,6 +23,7 @@
'router' => [
'resource' => '%kernel.project_dir%/config/routing.xml',
'type' => 'xml',
'utf8' => true,
],
'session' => [
'storage_id' => 'session.storage.native',
@@ -14,7 +14,7 @@
<framework:esi enabled="true" />
<framework:ssi enabled="true" />
<framework:profiler only-exceptions="true" enabled="false" />
<framework:router resource="%kernel.project_dir%/config/routing.xml" type="xml" />
<framework:router resource="%kernel.project_dir%/config/routing.xml" type="xml" utf8="true" />
<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" />
<framework:request>
<framework:format name="csv">
@@ -16,6 +16,7 @@ framework:
router:
resource: '%kernel.project_dir%/config/routing.xml'
type: xml
utf8: true
session:
storage_id: session.storage.native
handler_id: session.handler.native_file
@@ -1,6 +1,6 @@
framework:
secret: test
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml" }
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml", utf8: true }
validation: { enabled: true, enable_annotations: true }
csrf_protection: true
form: true
@@ -91,6 +91,7 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
$c->register('logger', NullLogger::class);
$c->loadFromExtension('framework', [
'secret' => '$ecret',
'router' => ['utf8' => true],
]);

$c->setParameter('halloween', 'Have a great day!');
@@ -81,5 +81,7 @@ protected function configureContainer(ContainerConfigurator $c)
->set('stdClass', 'stdClass')
->factory([$this, 'createHalloween'])
->arg('$halloween', '%halloween%');

$c->extension('framework', ['router' => ['utf8' => true]]);
}
}
@@ -140,7 +140,7 @@ private function createContainer($sessionStorageOptions)
];

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

$ext = new SecurityExtension();
$ext->load($config, $container);
@@ -1,6 +1,6 @@
framework:
secret: test
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml" }
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml", utf8: true }
validation: { enabled: true, enable_annotations: true }
csrf_protection: true
form: true
@@ -1,6 +1,6 @@
framework:
secret: test
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml" }
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml", utf8: true }
validation: { enabled: true, enable_annotations: true }
csrf_protection: true
form: true
@@ -1,6 +1,6 @@
framework:
secret: test
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml" }
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml", utf8: true }
test: ~
default_locale: en
profiler: false
@@ -1,6 +1,6 @@
framework:
secret: test
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml" }
router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml", utf8: true }
validation: { enabled: true, enable_annotations: true }
assets: ~
csrf_protection: true
@@ -43,6 +43,7 @@ protected function configureContainer(ContainerBuilder $containerBuilder, Loader
'secret' => 'foo-secret',
'profiler' => ['only_exceptions' => false],
'session' => ['storage_id' => 'session.storage.mock_file'],
'router' => ['utf8' => true],
]);

$containerBuilder->loadFromExtension('web_profiler', [

0 comments on commit 84849bc

Please sign in to comment.
You can’t perform that action at this time.