Libraryupgrader has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/380204 )
Change subject: build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
......................................................................
build: Updating mediawiki/mediawiki-codesniffer to 13.0.0
Change-Id: I768ba4d9887c2c221978d57f0c6f9e544e6617f4
---
M api/MWOAuthSessionProvider.php
M backend/MWOAuth.hooks.php
M backend/MWOAuthDataStore.php
M backend/MWOAuthRequest.php
M backend/MWOAuthServer.php
M backend/MWOAuthUtils.php
M composer.json
M frontend/EchoOAuthStageChangePresentationModel.php
M frontend/MWOAuthUI.hooks.php
M frontend/MWOAuthUIUtils.php
M frontend/specialpages/SpecialMWOAuth.php
M frontend/specialpages/SpecialMWOAuthConsumerRegistration.php
M frontend/specialpages/SpecialMWOAuthListConsumers.php
M frontend/specialpages/SpecialMWOAuthManageConsumers.php
M frontend/specialpages/SpecialMWOAuthManageMyGrants.php
15 files changed, 23 insertions(+), 28 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth
refs/changes/04/380204/1
diff --git a/api/MWOAuthSessionProvider.php b/api/MWOAuthSessionProvider.php
index 4b16f2d..f5cb4bf 100644
--- a/api/MWOAuthSessionProvider.php
+++ b/api/MWOAuthSessionProvider.php
@@ -87,7 +87,7 @@
}
$wiki = wfWikiID();
- $dbr = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $dbr = MWOAuthUtils::getCentralDB( DB_REPLICA );
// Access token is for this wiki
$access = MWOAuthConsumerAcceptance::newFromToken( $dbr,
$accesstoken->key );
@@ -263,7 +263,7 @@
public function onRecentChange_save( $rc ) {
$data = $this->getSessionData( $rc->getPerformer() ?: null );
if ( $data ) {
- $dbr = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $dbr = MWOAuthUtils::getCentralDB( DB_REPLICA );
$access = MWOAuthConsumerAcceptance::newFromToken(
$dbr, $data['key'] );
$consumerId = $access->get( 'consumerId' );
$consumer = MWOAuthConsumer::newFromId( $dbr,
$consumerId );
diff --git a/backend/MWOAuth.hooks.php b/backend/MWOAuth.hooks.php
index e558571..42683e9 100644
--- a/backend/MWOAuth.hooks.php
+++ b/backend/MWOAuth.hooks.php
@@ -99,7 +99,7 @@
*/
public static function getUsedConsumerTags( $activeOnly, &$tags ) {
// Step 1: Get the list of (active) consumers' tags for this
wiki
- $db = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $db = MWOAuthUtils::getCentralDB( DB_REPLICA );
$conds = [
$db->makeList( [
'oarc_wiki = ' . $db->addQuotes( '*' ),
@@ -127,7 +127,7 @@
// Step 2: Return only those that are in use.
if ( $allTags ) {
- $db = wfGetDB( DB_SLAVE );
+ $db = wfGetDB( DB_REPLICA );
$res = $db->select(
'change_tag',
[ 'ct_tag' ],
diff --git a/backend/MWOAuthDataStore.php b/backend/MWOAuthDataStore.php
index 338f0a8..02fbe00 100644
--- a/backend/MWOAuthDataStore.php
+++ b/backend/MWOAuthDataStore.php
@@ -3,7 +3,6 @@
namespace MediaWiki\Extensions\OAuth;
use MediaWiki\Logger\LoggerFactory;
-use Psr\Log\LoggerInterface;
class MWOAuthDataStore extends OAuthDataStore {
/** @var \DBConnRef DB for the consumer/grant registry */
diff --git a/backend/MWOAuthRequest.php b/backend/MWOAuthRequest.php
index 102fbae..840ce50 100644
--- a/backend/MWOAuthRequest.php
+++ b/backend/MWOAuthRequest.php
@@ -3,7 +3,6 @@
namespace MediaWiki\Extensions\OAuth;
use MediaWiki\Logger\LoggerFactory;
-use Psr\Log\LoggerInterface;
/**
* @file
diff --git a/backend/MWOAuthServer.php b/backend/MWOAuthServer.php
index 6cc61d1..4905e29 100644
--- a/backend/MWOAuthServer.php
+++ b/backend/MWOAuthServer.php
@@ -385,7 +385,7 @@
* @return MWOAuthConsumerAcceptance
*/
public function getCurrentAuthorization( \User $mwUser, $consumer,
$wikiId ) {
- $dbr = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $dbr = MWOAuthUtils::getCentralDB( DB_REPLICA );
$centralUserId = MWOAuthUtils::getCentralIdFromLocalUser(
$mwUser );
if ( !$centralUserId ) {
diff --git a/backend/MWOAuthUtils.php b/backend/MWOAuthUtils.php
index c5c1546..dc2005c 100644
--- a/backend/MWOAuthUtils.php
+++ b/backend/MWOAuthUtils.php
@@ -192,7 +192,7 @@
* @return MWOAuthServer with default configurations
*/
public static function newMWOAuthServer() {
- $dbr = self::getCentralDB( DB_SLAVE );
+ $dbr = self::getCentralDB( DB_REPLICA );
$dbw = wfGetLB()->getServerCount() > 1 ? self::getCentralDB(
DB_MASTER ) : null;
$store = new MWOAuthDataStore( $dbr, $dbw,
self::getSessionCache() );
$server = new MWOAuthServer( $store );
diff --git a/composer.json b/composer.json
index 9f2dde7..8f65b20 100644
--- a/composer.json
+++ b/composer.json
@@ -10,7 +10,7 @@
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
- "mediawiki/mediawiki-codesniffer": "0.12.0",
+ "mediawiki/mediawiki-codesniffer": "13.0.0",
"jakub-onderka/php-console-highlighter": "0.3.2"
},
"scripts": {
diff --git a/frontend/EchoOAuthStageChangePresentationModel.php
b/frontend/EchoOAuthStageChangePresentationModel.php
index 3137202..0ebd8ca 100644
--- a/frontend/EchoOAuthStageChangePresentationModel.php
+++ b/frontend/EchoOAuthStageChangePresentationModel.php
@@ -4,7 +4,6 @@
use EchoAttributeManager;
use EchoEventPresentationModel;
-use MediaWiki\Logger\LoggerFactory;
use MWException;
use User;
use SpecialPage;
@@ -92,7 +91,7 @@
*/
protected function getConsumer() {
if ( $this->consumer === null ) {
- $dbr = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $dbr = MWOAuthUtils::getCentralDB( DB_REPLICA );
$this->consumer =
MWOAuthConsumer::newFromKey( $dbr,
$this->event->getExtraParam( 'app-key' ) );
}
diff --git a/frontend/MWOAuthUI.hooks.php b/frontend/MWOAuthUI.hooks.php
index 194a1e7..f70f5ca 100644
--- a/frontend/MWOAuthUI.hooks.php
+++ b/frontend/MWOAuthUI.hooks.php
@@ -17,7 +17,7 @@
* @throws \MWException
*/
public static function onGetPreferences( $user, &$preferences ) {
- $dbr = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $dbr = MWOAuthUtils::getCentralDB( DB_REPLICA );
$conds = [
'oaac_consumer_id = oarc_id',
'oaac_user_id' =>
MWOAuthUtils::getCentralIdFromLocalUser( $user ),
@@ -71,7 +71,7 @@
return true;
}
- $dbr = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $dbr = MWOAuthUtils::getCentralDB( DB_REPLICA );
$cmr = MWOAuthDAOAccessControl::wrap(
MWOAuthConsumer::newFromId( $dbr, $m[1] ),
\RequestContext::getMain()
);
diff --git a/frontend/MWOAuthUIUtils.php b/frontend/MWOAuthUIUtils.php
index 4c3fca5..8d8aa1d 100644
--- a/frontend/MWOAuthUIUtils.php
+++ b/frontend/MWOAuthUIUtils.php
@@ -2,7 +2,6 @@
namespace MediaWiki\Extensions\OAuth;
-use Html;
use IContextSource;
use Message;
use OOUI\Tag;
diff --git a/frontend/specialpages/SpecialMWOAuth.php
b/frontend/specialpages/SpecialMWOAuth.php
index 0960474..e36708f 100644
--- a/frontend/specialpages/SpecialMWOAuth.php
+++ b/frontend/specialpages/SpecialMWOAuth.php
@@ -23,7 +23,6 @@
use Firebase\JWT\JWT;
use MediaWiki\Logger\LoggerFactory;
-use Psr\Log\LoggerInterface;
/**
* Page that handles OAuth consumer authorization and token exchange
@@ -159,7 +158,7 @@
/** @var MWOAuthToken $token */
$wiki = wfWikiID();
- $dbr = MWOAuthUtils::getCentralDB(
DB_SLAVE );
+ $dbr = MWOAuthUtils::getCentralDB(
DB_REPLICA );
$access =
MWOAuthConsumerAcceptance::newFromToken( $dbr, $token->key );
$localUser =
MWOAuthUtils::getLocalUserFromCentralId( $access->get( 'userId' ) );
if ( !$localUser ||
!$localUser->isLoggedIn() ) {
@@ -185,7 +184,7 @@
break;
default:
$format = $request->getVal( 'format',
'html' );
- $dbr = MWOAuthUtils::getCentralDB(
DB_SLAVE );
+ $dbr = MWOAuthUtils::getCentralDB(
DB_REPLICA );
$cmr = MWOAuthDAOAccessControl::wrap(
MWOAuthConsumer::newFromKey(
$dbr,
@@ -229,7 +228,7 @@
protected function showCancelPage() {
$request = $this->getRequest();
$consumerKey = $request->getVal( 'consumerKey',
$request->getVal( 'oauth_consumer_key' ) );
- $dbr = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $dbr = MWOAuthUtils::getCentralDB( DB_REPLICA );
$cmr = MWOAuthDAOAccessControl::wrap(
MWOAuthConsumer::newFromKey( $dbr, $consumerKey ),
$this->getContext()
@@ -307,7 +306,7 @@
$user = $this->getUser();
$lang = $this->getLanguage();
- $dbr = MWOAuthUtils::getCentralDB( DB_SLAVE ); // @TODO: lazy
handle
+ $dbr = MWOAuthUtils::getCentralDB( DB_REPLICA ); // @TODO: lazy
handle
$oauthServer = MWOAuthUtils::newMWOAuthServer();
if ( !$consumerKey ) {
diff --git a/frontend/specialpages/SpecialMWOAuthConsumerRegistration.php
b/frontend/specialpages/SpecialMWOAuthConsumerRegistration.php
index 99ce3f3..05b8251 100644
--- a/frontend/specialpages/SpecialMWOAuthConsumerRegistration.php
+++ b/frontend/specialpages/SpecialMWOAuthConsumerRegistration.php
@@ -264,7 +264,7 @@
throw new \PermissionsError(
'mwoauthupdateownconsumer' );
}
- $dbr = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $dbr = MWOAuthUtils::getCentralDB( DB_REPLICA );
$cmr = MWOAuthDAOAccessControl::wrap(
MWOAuthConsumer::newFromKey( $dbr, $consumerKey
), $this->getContext() );
if ( !$cmr ) {
@@ -525,7 +525,7 @@
$this->mConds['oarc_deleted'] = 0;
}
- $this->mDb = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $this->mDb = MWOAuthUtils::getCentralDB( DB_REPLICA );
parent::__construct();
# Treat 20 as the default limit, since each entry takes up 5
rows.
diff --git a/frontend/specialpages/SpecialMWOAuthListConsumers.php
b/frontend/specialpages/SpecialMWOAuthListConsumers.php
index cbc7627..61c6832 100644
--- a/frontend/specialpages/SpecialMWOAuthListConsumers.php
+++ b/frontend/specialpages/SpecialMWOAuthListConsumers.php
@@ -67,7 +67,7 @@
$out->addWikiMsg( 'mwoauth-missing-consumer-key' );
}
- $dbr = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $dbr = MWOAuthUtils::getCentralDB( DB_REPLICA );
$cmr = MWOAuthDAOAccessControl::wrap(
MWOAuthConsumer::newFromKey( $dbr, $consumerKey ),
$this->getContext() );
if ( !$cmr ) {
@@ -308,7 +308,7 @@
$this->mConds['oarc_deleted'] = 0;
}
- $this->mDb = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $this->mDb = MWOAuthUtils::getCentralDB( DB_REPLICA );
parent::__construct();
# Treat 20 as the default limit, since each entry takes up 5
rows.
diff --git a/frontend/specialpages/SpecialMWOAuthManageConsumers.php
b/frontend/specialpages/SpecialMWOAuthManageConsumers.php
index 3ebd911..6d04ed7 100644
--- a/frontend/specialpages/SpecialMWOAuthManageConsumers.php
+++ b/frontend/specialpages/SpecialMWOAuthManageConsumers.php
@@ -151,7 +151,7 @@
$out->addWikiMsg( 'mwoauthmanageconsumers-maintext' );
- $counts = MWOAuthUtils::getConsumerStateCounts(
MWOAuthUtils::getCentralDB( DB_SLAVE ) );
+ $counts = MWOAuthUtils::getConsumerStateCounts(
MWOAuthUtils::getCentralDB( DB_REPLICA ) );
$out->wrapWikiMsg( "<p><strong>$1</strong></p>",
'mwoauthmanageconsumers-queues' );
$out->addHTML( '<ul>' );
@@ -198,7 +198,7 @@
protected function handleConsumerForm( $consumerKey ) {
$user = $this->getUser();
$lang = $this->getLanguage();
- $dbr = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $dbr = MWOAuthUtils::getCentralDB( DB_REPLICA );
$cmr = MWOAuthDAOAccessControl::wrap(
MWOAuthConsumer::newFromKey( $dbr, $consumerKey ),
$this->getContext() );
if ( !$cmr ) {
@@ -478,7 +478,7 @@
$this->mConds['oarc_deleted'] = 0;
}
- $this->mDb = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $this->mDb = MWOAuthUtils::getCentralDB( DB_REPLICA );
parent::__construct();
# Treat 20 as the default limit, since each entry takes up 5
rows.
diff --git a/frontend/specialpages/SpecialMWOAuthManageMyGrants.php
b/frontend/specialpages/SpecialMWOAuthManageMyGrants.php
index d582a17..db48ea0 100644
--- a/frontend/specialpages/SpecialMWOAuthManageMyGrants.php
+++ b/frontend/specialpages/SpecialMWOAuthManageMyGrants.php
@@ -110,7 +110,7 @@
protected function handleConsumerForm( $acceptanceId, $type ) {
$user = $this->getUser();
$lang = $this->getLanguage();
- $dbr = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $dbr = MWOAuthUtils::getCentralDB( DB_REPLICA );
$centralUserId = MWOAuthUtils::getCentralIdFromLocalUser( $user
);
if ( !$centralUserId ) {
@@ -336,7 +336,7 @@
$this->mConds['oarc_deleted'] = 0;
}
- $this->mDb = MWOAuthUtils::getCentralDB( DB_SLAVE );
+ $this->mDb = MWOAuthUtils::getCentralDB( DB_REPLICA );
parent::__construct();
# Treat 20 as the default limit, since each entry takes up 5
rows.
--
To view, visit https://gerrit.wikimedia.org/r/380204
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I768ba4d9887c2c221978d57f0c6f9e544e6617f4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: Libraryupgrader <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits