Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Dbal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Netleak
Dbal
Commits
c50a58e3
Commit
c50a58e3
authored
4 years ago
by
Joe Bennett
Browse files
Options
Downloads
Patches
Plain Diff
#4295 Restored master, slaves, keepReplica params in MasterSlaveConnection
parent
16878650
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php
+0
-3
0 additions, 3 deletions
lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php
tests/Doctrine/Tests/DBAL/Connections/MasterSlaveConnectionTest.php
+39
-0
39 additions, 0 deletions
...rine/Tests/DBAL/Connections/MasterSlaveConnectionTest.php
with
39 additions
and
3 deletions
lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php
+
0
−
3
View file @
c50a58e3
...
...
@@ -38,21 +38,18 @@ class MasterSlaveConnection extends PrimaryReadReplicaConnection
$this
->
deprecated
(
'Params key "master"'
,
'"primary"'
);
$params
[
'primary'
]
=
$params
[
'master'
];
unset
(
$params
[
'master'
]);
}
if
(
isset
(
$params
[
'slaves'
]))
{
$this
->
deprecated
(
'Params key "slaves"'
,
'"replica"'
);
$params
[
'replica'
]
=
$params
[
'slaves'
];
unset
(
$params
[
'slaves'
]);
}
if
(
isset
(
$params
[
'keepSlave'
]))
{
$this
->
deprecated
(
'Params key "keepSlave"'
,
'"keepReplica"'
);
$params
[
'keepReplica'
]
=
$params
[
'keepSlave'
];
unset
(
$params
[
'keepSlave'
]);
}
parent
::
__construct
(
$params
,
$driver
,
$config
,
$eventManager
);
...
...
This diff is collapsed.
Click to expand it.
tests/Doctrine/Tests/DBAL/Connections/MasterSlaveConnectionTest.php
0 → 100644
+
39
−
0
View file @
c50a58e3
<?php
namespace
Doctrine\Tests\DBAL\Connections
;
use
Doctrine\DBAL\Connections\MasterSlaveConnection
;
use
Doctrine\DBAL\Driver
;
use
Doctrine\Tests\DbalTestCase
;
class
MasterSlaveConnectionTest
extends
DbalTestCase
{
public
function
testConnectionParamsRemainAvailable
():
void
{
$constructionParams
=
[
'driver'
=>
'pdo_mysql'
,
'keepSlave'
=>
true
,
'master'
=>
[
'host'
=>
'master.host'
,
'user'
=>
'root'
,
'password'
=>
'password'
,
'port'
=>
'1234'
,
],
'slaves'
=>
[
[
'host'
=>
'slave1.host'
,
'user'
=>
'root'
,
'password'
=>
'password'
,
'port'
=>
'1234'
,
],
],
];
$connection
=
new
MasterSlaveConnection
(
$constructionParams
,
$this
->
createStub
(
Driver
::
class
));
$connectionParams
=
$connection
->
getParams
();
foreach
(
$constructionParams
as
$key
=>
$value
)
{
self
::
assertSame
(
$value
,
$connectionParams
[
$key
]);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment