Fix wfGetDB deprecated on 1.39 and later versions.
The global function wfGetDB() has been deprecated since 1.39, use LoadBalancer::getConnection() instead of old function. Bug: T369145 Change-Id: Ided5ed8d1e54428541f067c75fbe7fdfeefc460f
This commit is contained in:
parent
1cf9ae8247
commit
00af3f2598
1 changed files with 4 additions and 2 deletions
|
@ -33,7 +33,8 @@ class ContributionScores extends IncludableSpecialPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = User::newFromName( $usertext );
|
$user = User::newFromName( $usertext );
|
||||||
$dbr = wfGetDB( DB_REPLICA );
|
$loadBalancer = MediaWikiServices::getInstance()->getDBLoadBalancer();
|
||||||
|
$dbr = $loadBalancer->getConnection( DB_REPLICA );
|
||||||
|
|
||||||
if ( $user instanceof User && $user->isRegistered() ) {
|
if ( $user instanceof User && $user->isRegistered() ) {
|
||||||
global $wgLang;
|
global $wgLang;
|
||||||
|
@ -90,7 +91,8 @@ class ContributionScores extends IncludableSpecialPage {
|
||||||
global $wgContribScoreIgnoreBots, $wgContribScoreIgnoreBlockedUsers, $wgContribScoreIgnoreUsernames,
|
global $wgContribScoreIgnoreBots, $wgContribScoreIgnoreBlockedUsers, $wgContribScoreIgnoreUsernames,
|
||||||
$wgContribScoreUseRoughEditCount;
|
$wgContribScoreUseRoughEditCount;
|
||||||
|
|
||||||
$dbr = wfGetDB( DB_REPLICA );
|
$loadBalancer = MediaWikiServices::getInstance()->getDBLoadBalancer();
|
||||||
|
$dbr = $loadBalancer->getConnection( DB_REPLICA );
|
||||||
|
|
||||||
$revQuery = ActorMigration::newMigration()->getJoin( 'rev_user' );
|
$revQuery = ActorMigration::newMigration()->getJoin( 'rev_user' );
|
||||||
$revQuery['tables'] = array_merge( [ 'revision' ], $revQuery['tables'] );
|
$revQuery['tables'] = array_merge( [ 'revision' ], $revQuery['tables'] );
|
||||||
|
|
Loading…
Add table
Reference in a new issue