diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md
index 8f34967b2..61c589f06 100644
--- a/UPGRADE-3.0.md
+++ b/UPGRADE-3.0.md
@@ -64,6 +64,21 @@ Use `doctrine.dbal.default_table_options.collation` instead.
There is no replacement for this option.
+### The `doctrine.dbal.types.some_custom_type.commented` option is removed
+
+The `commented` option for custom types is no longer supported and has been
+removed.
+
+### The `doctrine.dbal.connection.some_connection.platform_service` option is removed
+
+The `platform_service` option for connections is no longer supported and has
+been removed.
+
+### The `doctrine.dbal.connection.some_connection.keep_slave` and `doctrine.dbal.connection.some_connection.slaves` option is removed
+
+`doctrine.dbal.connection.some_connection.slaves` becomes
+`doctrine.dbal.connection.some_connection.replicas`.
+
### Controller resolver auto mapping can no longer be configured
The `doctrine.orm.controller_resolver.auto_mapping` option now only accepts `false` as value, to disallow the usage of the controller resolver auto mapping feature by default. The configuration option will be fully removed in 4.0.
@@ -94,9 +109,3 @@ Type declarations
Native type declarations have been added to all constants, properties, and
methods.
-
-Types
------
-
- * The `commented` configuration option for types is no longer supported and
- deprecated.
diff --git a/config/schema/doctrine-1.0.xsd b/config/schema/doctrine-1.0.xsd
index b5a882cca..516907032 100644
--- a/config/schema/doctrine-1.0.xsd
+++ b/config/schema/doctrine-1.0.xsd
@@ -28,9 +28,7 @@
-
-
@@ -81,7 +79,6 @@
-
diff --git a/docs/en/configuration.rst b/docs/en/configuration.rst
index aa08f38c9..2d2366a4f 100644
--- a/docs/en/configuration.rst
+++ b/docs/en/configuration.rst
@@ -417,7 +417,6 @@ Configuration Reference
MultipleActiveResultSets=""
use-savepoints="true"
driver="pdo_mysql"
- platform-service=""
auto-commit=""
schema-filter=""
logging="%kernel.debug%"
@@ -944,7 +943,6 @@ can configure. The following block shows all possible configuration keys:
wrapper-class="MyDoctrineDbalConnectionWrapper"
charset=""
logging="%kernel.debug%"
- platform-service="MyOwnDatabasePlatformService"
auto-commit="false"
schema-filter="^sf2_"
>
diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php
index bd19aced6..e6327cc94 100644
--- a/src/DependencyInjection/Configuration.php
+++ b/src/DependencyInjection/Configuration.php
@@ -114,13 +114,6 @@ private function addDbalSection(ArrayNodeDefinition $node): void
->end()
->children()
->scalarNode('class')->isRequired()->end()
- ->booleanNode('commented')
- ->setDeprecated(
- 'doctrine/doctrine-bundle',
- '2.0',
- 'The doctrine-bundle type commenting features were removed; the corresponding config parameter was deprecated in 2.0 and will be dropped in 3.0.',
- )
- ->end()
->end()
->end()
->end()
@@ -178,18 +171,10 @@ private function getDbalConnectionsNode(): ArrayNodeDefinition
$connectionNode
->fixXmlConfig('option')
->fixXmlConfig('mapping_type')
- ->fixXmlConfig('slave')
->fixXmlConfig('replica')
->fixXmlConfig('default_table_option')
->children()
->scalarNode('driver')->defaultValue('pdo_mysql')->end()
- ->scalarNode('platform_service')
- ->setDeprecated(
- 'doctrine/doctrine-bundle',
- '2.9',
- 'The "platform_service" configuration key is deprecated since doctrine-bundle 2.9. DBAL 4 will not support setting a custom platform via connection params anymore.',
- )
- ->end()
->booleanNode('auto_commit')->end()
->scalarNode('schema_filter')->end()
->booleanNode('logging')->defaultValue($this->debug)->end()
@@ -207,13 +192,6 @@ private function getDbalConnectionsNode(): ArrayNodeDefinition
->integerNode('idle_connection_ttl')->defaultValue(600)->end()
->scalarNode('driver_class')->end()
->scalarNode('wrapper_class')->end()
- ->booleanNode('keep_slave')
- ->setDeprecated(
- 'doctrine/doctrine-bundle',
- '2.2',
- 'The "keep_slave" configuration key is deprecated since doctrine-bundle 2.2. Use the "keep_replica" configuration key instead.',
- )
- ->end()
->booleanNode('keep_replica')->end()
->arrayNode('options')
->useAttributeAsKey('key')
@@ -237,27 +215,14 @@ private function getDbalConnectionsNode(): ArrayNodeDefinition
->scalarNode('result_cache')->end()
->end();
- // dbal < 2.11
- $slaveNode = $connectionNode
- ->children()
- ->arrayNode('slaves')
- ->setDeprecated(
- 'doctrine/doctrine-bundle',
- '2.2',
- 'The "slaves" configuration key will be renamed to "replicas" in doctrine-bundle 3.0. "slaves" is deprecated since doctrine-bundle 2.2.',
- )
- ->useAttributeAsKey('name')
- ->prototype('array');
- /* @phpstan-ignore argument.type (symfony plugin needed) */
- $this->configureDbalDriverNode($slaveNode);
-
- // dbal >= 2.11
$replicaNode = $connectionNode
->children()
->arrayNode('replicas')
->useAttributeAsKey('name')
->prototype('array');
- /* @phpstan-ignore argument.type (symfony plugin needed) */
+
+ assert($replicaNode instanceof ArrayNodeDefinition);
+
$this->configureDbalDriverNode($replicaNode);
assert($node instanceof ArrayNodeDefinition);
diff --git a/src/DependencyInjection/DoctrineExtension.php b/src/DependencyInjection/DoctrineExtension.php
index ed5176740..1dffced6f 100644
--- a/src/DependencyInjection/DoctrineExtension.php
+++ b/src/DependencyInjection/DoctrineExtension.php
@@ -341,15 +341,8 @@ protected function getConnectionOptions(array $connection): array
$options += $connectionDefaults;
- foreach (['replicas', 'slaves'] as $connectionKey) {
- foreach (array_keys($options[$connectionKey]) as $name) {
- $options[$connectionKey][$name] += $connectionDefaults;
- }
- }
-
- if (isset($options['platform_service'])) {
- $options['platform'] = new Reference($options['platform_service']);
- unset($options['platform_service']);
+ foreach (array_keys($options['replicas']) as $name) {
+ $options['replicas'][$name] += $connectionDefaults;
}
unset($options['mapping_types']);
@@ -359,7 +352,6 @@ protected function getConnectionOptions(array $connection): array
'options' => 'driverOptions',
'driver_class' => 'driverClass',
'wrapper_class' => 'wrapperClass',
- 'keep_slave' => 'keepReplica',
'keep_replica' => 'keepReplica',
'replicas' => 'replica',
'server_version' => 'serverVersion',
@@ -374,27 +366,23 @@ protected function getConnectionOptions(array $connection): array
unset($options[$old]);
}
- foreach (['replica', 'slaves'] as $connectionKey) {
- foreach ($options[$connectionKey] as $name => $value) {
- $driverOptions = $value['driverOptions'] ?? [];
- $parentDriverOptions = $options['driverOptions'] ?? [];
- if ($driverOptions === [] && $parentDriverOptions === []) {
- continue;
- }
-
- $options[$connectionKey][$name]['driverOptions'] = $driverOptions + $parentDriverOptions;
+ foreach ($options['replica'] as $name => $value) {
+ $driverOptions = $value['driverOptions'] ?? [];
+ $parentDriverOptions = $options['driverOptions'] ?? [];
+ if ($driverOptions === [] && $parentDriverOptions === []) {
+ continue;
}
+
+ $options['replica'][$name]['driverOptions'] = $driverOptions + $parentDriverOptions;
}
- if (! empty($options['slaves']) || ! empty($options['replica'])) {
+ if (! empty($options['replica'])) {
$nonRewrittenKeys = [
'driver' => true,
'driverClass' => true,
'wrapperClass' => true,
- 'keepSlave' => true,
'keepReplica' => true,
'platform' => true,
- 'slaves' => true,
'primary' => true,
'replica' => true,
'serverVersion' => true,
@@ -419,7 +407,7 @@ protected function getConnectionOptions(array $connection): array
$options['wrapperClass'] = PrimaryReadReplicaConnection::class;
}
} else {
- unset($options['slaves'], $options['replica']);
+ unset($options['replica']);
}
return $options;