8000 [FrameworkBundle] Deprecate *not* setting the "framework.router.utf8" option by nicolas-grekas · Pull Request #35310 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] Deprecate *not* setting the "framework.router.utf8" option #35310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions UPGRADE-5.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------
Expand Down
1 change: 1 addition & 0 deletions UPGRADE-6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ FrameworkBundle
---------------

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

HttpFoundation
--------------
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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%',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'router' => [
'resource' => '%kernel.project_dir%/config/routing.xml',
'type' => 'xml',
'utf8' => true,
],
'session' => [
'storage_id' => 'session.storage.native',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,7 @@ protected function configureContainer(ContainerConfigurator $c)
->set('stdClass', 'stdClass')
->factory([$this, 'createHalloween'])
->arg('$halloween', '%halloween%');

$c->extension('framework', ['router' => ['utf8' => true]]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10669
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand Down
0