Skip to content

Commit

Permalink
Remove deprecated configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Dec 19, 2023
1 parent 232f6c3 commit 53c5089
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 25 deletions.
8 changes: 0 additions & 8 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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 {
Expand Down
7 changes: 0 additions & 7 deletions Resources/config/schema/mongodb-1.0.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
</xsd:complexType>

<xsd:complexType name="default-commit-options">
<xsd:attribute name="fsync" type="xsd:boolean" />
<xsd:attribute name="j" type="xsd:boolean" />
<xsd:attribute name="safe" type="xsd:string" />
<xsd:attribute name="timeout" type="xsd:integer" />
<xsd:attribute name="w" type="xsd:string" />
<xsd:attribute name="wtimeout" type="xsd:integer" />
Expand Down Expand Up @@ -83,11 +81,6 @@
<xsd:attribute name="retryWrites" type="xsd:boolean" />
<xsd:attribute name="w" type="xsd:string" />
<xsd:attribute name="wTimeoutMS" type="xsd:integer" />
<!-- deprecated options -->
<xsd:attribute name="fsync" type="xsd:boolean" />
<xsd:attribute name="slaveOkay" type="xsd:boolean" />
<xsd:attribute name="timeout" type="xsd:integer" />
<xsd:attribute name="wTimeout" type="xsd:integer" />
</xsd:complexType>

<xsd:complexType name="connection-driver-options">
Expand Down
5 changes: 1 addition & 4 deletions Tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ public function testFullConfiguration(array $config): void
'timeout' => 10,
'w' => 'majority',
'wtimeout' => 10,
'fsync' => false,
'safe' => 2,
],
'connections' => [
'conn1' => [
Expand All @@ -101,7 +99,6 @@ public function testFullConfiguration(array $config): void
[],
],
'replicaSet' => 'foo',
'slaveOkay' => true,
'socketTimeoutMS' => 1000,
'ssl' => true,
'tls' => true,
Expand Down Expand Up @@ -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']]]],
Expand Down
3 changes: 0 additions & 3 deletions Tests/DependencyInjection/Fixtures/config/xml/full.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
timeout="10"
w="majority"
wtimeout="10"
fsync="false"
safe="2"
/>

<doctrine:connection id="conn1" server="mongodb://localhost">
Expand All @@ -39,7 +37,6 @@
password="password_val"
readPreference="secondaryPreferred"
replicaSet="foo"
slaveOkay="true"
socketTimeoutMS="1000"
ssl="true"
tls="true"
Expand Down
3 changes: 0 additions & 3 deletions Tests/DependencyInjection/Fixtures/config/yml/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ doctrine_mongodb:
timeout: 10
w: majority
wtimeout: 10
fsync: false
safe: 2

connections:
conn1:
Expand All @@ -38,7 +36,6 @@ doctrine_mongodb:
- { dc: west }
- { }
replicaSet: foo
slaveOkay: true
socketTimeoutMS: 1000
ssl: true
tls: true
Expand Down
13 changes: 13 additions & 0 deletions UPGRADE-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 53c5089

Please sign in to comment.