Skip to content

Commit a385a1d

Browse files
authored
Merge pull request #51 from mohe2015/fixes
Don't use deprecated method
2 parents f31b1c2 + 446361a commit a385a1d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/AuthManagerOAuthPrimaryAuthenticationProvider.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function getAuthenticationRequests( $action, array $options ) {
5151
|| $action === \MediaWiki\Auth\AuthManager::ACTION_UNLINK ) ) {
5252
$user = \User::newFromName( $options['username'] );
5353
$lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
54-
$dbr = $lb->getConnectionRef( DB_REPLICA );
54+
$dbr = $lb->getConnection( DB_REPLICA );
5555
$result = $dbr->select(
5656
'authmanageroauth_linked_accounts',
5757
[ 'amoa_provider', 'amoa_remote_user' ],
@@ -98,7 +98,7 @@ public function providerChangeAuthenticationData( AuthenticationRequest $req ) {
9898
|| $req->action === \MediaWiki\Auth\AuthManager::ACTION_UNLINK ) ) {
9999
$user = \User::newFromName( $req->username );
100100
$lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
101-
$dbr = $lb->getConnectionRef( DB_PRIMARY );
101+
$dbr = $lb->getConnection( DB_PRIMARY );
102102
$result = $dbr->delete(
103103
'authmanageroauth_linked_accounts',
104104
[
@@ -281,7 +281,7 @@ public function continuePrimaryAuthentication( array $reqs ) {
281281
}
282282

283283
$lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
284-
$dbr = $lb->getConnectionRef( DB_REPLICA );
284+
$dbr = $lb->getConnection( DB_REPLICA );
285285

286286
$result = $dbr->select(
287287
'authmanageroauth_linked_accounts',
@@ -329,7 +329,7 @@ public function continuePrimaryAccountLink( $user, array $reqs ) {
329329
}
330330

331331
$lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
332-
$dbr = $lb->getConnectionRef( DB_PRIMARY );
332+
$dbr = $lb->getConnection( DB_PRIMARY );
333333
$result = $dbr->insert(
334334
'authmanageroauth_linked_accounts',
335335
[
@@ -357,7 +357,7 @@ public function autoCreatedAccount( $user, $source ) {
357357
$auth_data = $this->manager->getAuthenticationSessionData( self::AUTHENTICATION_SESSION_DATA_REMOTE_USER );
358358
$this->manager->removeAuthenticationSessionData( self::AUTHENTICATION_SESSION_DATA_REMOTE_USER );
359359
$lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
360-
$dbr = $lb->getConnectionRef( DB_PRIMARY );
360+
$dbr = $lb->getConnection( DB_PRIMARY );
361361
$result = $dbr->insert(
362362
'authmanageroauth_linked_accounts',
363363
[
@@ -380,7 +380,7 @@ public function finishAccountCreation( $user, $creator, AuthenticationResponse $
380380
throw new LogicException( "Unexpected createRequest type {$request_class}. This should never happen." );
381381
}
382382
$lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
383-
$dbr = $lb->getConnectionRef( DB_PRIMARY );
383+
$dbr = $lb->getConnection( DB_PRIMARY );
384384
$result = $dbr->insert(
385385
'authmanageroauth_linked_accounts',
386386
[

0 commit comments

Comments
 (0)