From 53c5089192d70744384410ca6967098da91bfb5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Tue, 19 Dec 2023 22:11:21 +0100 Subject: [PATCH] Remove deprecated configuration --- DependencyInjection/Configuration.php | 8 -------- Resources/config/schema/mongodb-1.0.xsd | 7 ------- Tests/DependencyInjection/ConfigurationTest.php | 5 +---- .../Fixtures/config/xml/full.xml | 3 --- .../Fixtures/config/yml/full.yml | 3 --- UPGRADE-5.0.md | 13 +++++++++++++ 6 files changed, 14 insertions(+), 25 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 9f03237c..92da7cea 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -86,9 +86,6 @@ public function getConfigTreeBuilder(): TreeBuilder ->integerNode('timeout')->end() ->scalarNode('w')->end() ->integerNode('wtimeout')->end() - // Deprecated options - ->booleanNode('fsync')->info('Deprecated. Please use the "j" option instead.')->end() - ->scalarNode('safe')->info('Deprecated. Please use the "w" option instead.')->end() ->end() ->end() ->arrayNode('controller_resolver') @@ -312,11 +309,6 @@ private function addConnectionsSection(ArrayNodeDefinition $rootNode): void ->booleanNode('retryWrites')->end() ->scalarNode('w')->end() ->integerNode('wTimeoutMS')->end() - // Deprecated options - ->booleanNode('fsync')->info('Deprecated. Please use the "journal" option instead.')->end() - ->booleanNode('slaveOkay')->info('Deprecated. Please use the "readPreference" option instead.')->end() - ->integerNode('timeout')->info('Deprecated. Please use the "connectTimeoutMS" option instead.')->end() - ->integerNode('wTimeout')->info('Deprecated. Please use the "wTimeoutMS" option instead.')->end() ->end() ->validate() ->ifTrue(static function ($v): bool { diff --git a/Resources/config/schema/mongodb-1.0.xsd b/Resources/config/schema/mongodb-1.0.xsd index 16daed56..4a63e8be 100644 --- a/Resources/config/schema/mongodb-1.0.xsd +++ b/Resources/config/schema/mongodb-1.0.xsd @@ -30,9 +30,7 @@ - - @@ -83,11 +81,6 @@ - - - - - diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/Tests/DependencyInjection/ConfigurationTest.php index 8036bfb7..5cbff3ad 100644 --- a/Tests/DependencyInjection/ConfigurationTest.php +++ b/Tests/DependencyInjection/ConfigurationTest.php @@ -83,8 +83,6 @@ public function testFullConfiguration(array $config): void 'timeout' => 10, 'w' => 'majority', 'wtimeout' => 10, - 'fsync' => false, - 'safe' => 2, ], 'connections' => [ 'conn1' => [ @@ -101,7 +99,6 @@ public function testFullConfiguration(array $config): void [], ], 'replicaSet' => 'foo', - 'slaveOkay' => true, 'socketTimeoutMS' => 1000, 'ssl' => true, 'tls' => true, @@ -276,7 +273,7 @@ public static function provideMergeOptions(): array // the "options" array is totally replaced $cases[] = [ [ - ['connections' => ['default' => ['options' => ['timeout' => 2000]]]], + ['connections' => ['default' => ['options' => ['socketTimeoutMS' => 2000]]]], ['connections' => ['default' => ['options' => ['username' => 'foo']]]], ], ['connections' => ['default' => ['options' => ['username' => 'foo']]]], diff --git a/Tests/DependencyInjection/Fixtures/config/xml/full.xml b/Tests/DependencyInjection/Fixtures/config/xml/full.xml index 893d4227..363038c3 100644 --- a/Tests/DependencyInjection/Fixtures/config/xml/full.xml +++ b/Tests/DependencyInjection/Fixtures/config/xml/full.xml @@ -26,8 +26,6 @@ timeout="10" w="majority" wtimeout="10" - fsync="false" - safe="2" /> @@ -39,7 +37,6 @@ password="password_val" readPreference="secondaryPreferred" replicaSet="foo" - slaveOkay="true" socketTimeoutMS="1000" ssl="true" tls="true" diff --git a/Tests/DependencyInjection/Fixtures/config/yml/full.yml b/Tests/DependencyInjection/Fixtures/config/yml/full.yml index d75ddc8b..5b3e8ef9 100644 --- a/Tests/DependencyInjection/Fixtures/config/yml/full.yml +++ b/Tests/DependencyInjection/Fixtures/config/yml/full.yml @@ -20,8 +20,6 @@ doctrine_mongodb: timeout: 10 w: majority wtimeout: 10 - fsync: false - safe: 2 connections: conn1: @@ -38,7 +36,6 @@ doctrine_mongodb: - { dc: west } - { } replicaSet: foo - slaveOkay: true socketTimeoutMS: 1000 ssl: true tls: true diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index 6fb6fd95..87a14e60 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -14,6 +14,19 @@ UPGRADE FROM 4.x to 5.0 used directly or extended. * Remove support of Annotation mapping, you should use Attributes or XML instead. +## Configuration + +Deprecated options have been removed: + +| namespace | removed | replaced by | +|--------------------------|-------------|--------------------| +| `default_commit_options` | `fsync` | `j` | +| `default_commit_options` | `safe` | `w` | +| `connections.*.options` | `fsync` | `journal` | +| `connections.*.options` | `slaveOkay` | `readPreference` | +| `connections.*.options` | `timeout` | `connectTimeoutMS` | +| `connections.*.options` | `wTimeout` | `wTimeoutMS` | + ## Fixtures * Remove `--service` option from `doctrine:mongodb:fixtures:load` command