Skip to content

Commit

Permalink
Update UPGRADE.md about deprecated MasterSlaveConnection [ci-skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Jun 7, 2020
1 parent 3e93264 commit 784a998
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# Upgrade to 2.11

## Deprecated `MasterSlaveConnection` use `PrimaryReplicaConnection`

The `Doctrine\DBAL\Connections\MasterSlaveConnection` class is renamed to `Doctrine\DBAL\Connections\PrimaryReplicaConnection`.
In addition its configuration parameters `master`, `slaves` and `keepSlave` are renamed to `primary`, `replica` and `keepReplica`.

Before:

$connection = DriverManager::getConnection(
'wrapperClass' => 'Doctrine\DBAL\Connections\MasterSlaveConnection',
'driver' => 'pdo_mysql',
'master' => array('user' => '', 'password' => '', 'host' => '', 'dbname' => ''),
'slaves' => array(
array('user' => 'replica1', 'password', 'host' => '', 'dbname' => ''),
array('user' => 'replica2', 'password', 'host' => '', 'dbname' => ''),
),
'keepSlave' => true,
));

After:

$connection = DriverManager::getConnection(array(
'wrapperClass' => 'Doctrine\DBAL\Connections\PrimaryReplicaConnection',
'driver' => 'pdo_mysql',
'primary' => array('user' => '', 'password' => '', 'host' => '', 'dbname' => ''),
'replica' => array(
array('user' => 'replica1', 'password', 'host' => '', 'dbname' => ''),
array('user' => 'replica2', 'password', 'host' => '', 'dbname' => ''),
)
'keepReplica' => true,
));

## Deprecated `ArrayStatement` and `ResultCacheStatement` classes.

The `ArrayStatement` and `ResultCacheStatement` classes are deprecated. In a future major release they will be renamed and marked internal as implementation details of the caching layer.

0 comments on commit 784a998

Please sign in to comment.