From 110df55da94c238a1258a1b5486ff0a1c26a4b38 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 24 Sep 2019 15:42:00 -0700 Subject: [PATCH] Avoid uses of wfWikiId() in maintenance/ Change-Id: I81904c0ba7120d7da2454929ffec5c1c0892be02 --- maintenance/cleanupTable.inc | 2 +- maintenance/userDupes.inc | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/maintenance/cleanupTable.inc b/maintenance/cleanupTable.inc index b78e691e8f..a7a6465727 100644 --- a/maintenance/cleanupTable.inc +++ b/maintenance/cleanupTable.inc @@ -87,7 +87,7 @@ class TableCleanup extends Maintenance { $this->output( sprintf( "%s %s: %6.2f%% done on %s; ETA %s [%d/%d] %.2f/sec <%.2f%% updated>\n", - wfWikiID(), + WikiMap::getCurrentWikiDbDomain()->getId(), wfTimestamp( TS_DB, intval( $now ) ), $portion * 100.0, $this->table, diff --git a/maintenance/userDupes.inc b/maintenance/userDupes.inc index 5f7f9d5e43..cbe5d27dc0 100644 --- a/maintenance/userDupes.inc +++ b/maintenance/userDupes.inc @@ -110,8 +110,9 @@ class UserDupes { * @return bool */ private function checkDupes( $doDelete = false ) { + $dbDomain = WikiMap::getCurrentWikiDbDomain()->getId(); if ( $this->hasUniqueIndex() ) { - echo wfWikiID() . " already has a unique index on its user table.\n"; + echo "$dbDomain already has a unique index on its user table.\n"; return true; } @@ -122,7 +123,7 @@ class UserDupes { $dupes = $this->getDupes(); $count = count( $dupes ); - $this->out( "Found $count accounts with duplicate records on " . wfWikiID() . ".\n" ); + $this->out( "Found $count accounts with duplicate records on $dbDomain.\n" ); $this->trimmed = 0; $this->reassigned = 0; $this->failed = 0; @@ -145,11 +146,13 @@ class UserDupes { if ( $this->trimmed > 0 ) { if ( $doDelete ) { - $this->out( "$this->trimmed duplicate user records were deleted from " - . wfWikiID() . ".\n" ); + $this->out( + "$this->trimmed duplicate user records were deleted from $dbDomain.\n" ); } else { - $this->out( "$this->trimmed duplicate user accounts were found on " - . wfWikiID() . " which can be removed safely.\n" ); + $this->out( + "$this->trimmed duplicate user accounts were found on $dbDomain " . + "which can be removed safely.\n" + ); } } -- 2.20.1