aboutsummaryrefslogtreecommitdiffstats
path: root/includes/revisiondelete
diff options
context:
space:
mode:
authorTChin <tchin@wikimedia.org>2022-01-06 13:44:56 -0500
committerTChin <tchin@wikimedia.org>2022-01-10 13:55:53 -0500
commit47adb6d65a9def579135a3d009fd1b22e99e51ba (patch)
treea8a90bace319d546819fc78ed682a024e0090f03 /includes/revisiondelete
parentfb80b943b67a17a85111692fa4ac675f148f05e6 (diff)
downloadmediawikicore-47adb6d65a9def579135a3d009fd1b22e99e51ba.tar.gz
mediawikicore-47adb6d65a9def579135a3d009fd1b22e99e51ba.zip
Refactor global variables to use MediaWikiServices instead
Automatically refactors wg prefixed globals to use MediaWikiServices config using Rector. Doesn't include files that set globals or files that fail CI. Rector Gist: https://gist.github.com/tchin25/7cc54f6d23aedef010b22e4dfbead228 * This patch uses a modified source code rector library for our specific use case and the rector will have different effects without it. A writeup for future reference is here: https://meta.wikimedia.org/wiki/User:TChin_(WMF)/Using_Rector_On_MediaWiki Change-Id: I1a691f01cd82e60bf41207d32501edb4b9835e37
Diffstat (limited to 'includes/revisiondelete')
-rw-r--r--includes/revisiondelete/RevisionDeleteUser.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/revisiondelete/RevisionDeleteUser.php b/includes/revisiondelete/RevisionDeleteUser.php
index 9959541a739d..097c5f66544b 100644
--- a/includes/revisiondelete/RevisionDeleteUser.php
+++ b/includes/revisiondelete/RevisionDeleteUser.php
@@ -21,6 +21,7 @@
* @ingroup RevisionDelete
*/
+use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\RevisionRecord;
use Wikimedia\Rdbms\IDatabase;
@@ -44,7 +45,8 @@ class RevisionDeleteUser {
* @return bool True on success, false on failure (e.g. invalid user ID)
*/
private static function setUsernameBitfields( $name, $userId, $op, IDatabase $dbw = null ) {
- global $wgActorTableSchemaMigrationStage;
+ $actorTableSchemaMigrationStage = MediaWikiServices::getInstance()
+ ->getMainConfig()->get( 'ActorTableSchemaMigrationStage' );
if ( !$userId || ( $op !== '|' && $op !== '&' ) ) {
return false;
@@ -76,7 +78,7 @@ class RevisionDeleteUser {
# write stage, because the stage determines how we find the rows to
# delete. The write stage determines whether or not to write to
# rev_actor and revision_actor_temp which is not relevant here.
- if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_TEMP ) {
+ if ( $actorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_TEMP ) {
$ids = $dbw->selectFieldValues(
'revision_actor_temp', 'revactor_rev', [ 'revactor_actor' => $actorId ], __METHOD__
);