jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/392365 )
Change subject: Update for Maintenance::error( $err, $die ) deprecation
......................................................................
Update for Maintenance::error( $err, $die ) deprecation
Depends-On: I75699008638f7e99b11210c7bb9e2e131fca7c9e
Change-Id: I0d53b8fe1cb1a8b9d25d6375b73b40621b4b570c
---
M addWiki.php
M bug-53687/fixOrphans.php
M changeSkinPref.php
M cleanupBug41615.php
M createExtensionTables.php
M dumpInterwiki.php
M getJobQueueLengths.php
M getPageCounts.php
M removeDeletedWikis.php
9 files changed, 18 insertions(+), 20 deletions(-)
Approvals:
Reedy: Looks good to me, approved
jenkins-bot: Verified
diff --git a/addWiki.php b/addWiki.php
index 3b6d80a..be26cbc 100644
--- a/addWiki.php
+++ b/addWiki.php
@@ -58,7 +58,7 @@
$wmgVersionNumber, $wmgAddWikiNotify, $wgPasswordSender;
if ( !$wmgVersionNumber ) { // set in CommonSettings.php
- $this->error( '$wmgVersionNumber is not set, please use
MWScript.php wrapper.', true );
+ $this->fatalError( '$wmgVersionNumber is not set,
please use MWScript.php wrapper.' );
}
$lang = $this->getArg( 0 );
@@ -68,7 +68,7 @@
$languageNames = Language::fetchLanguageNames();
if ( !isset( $languageNames[$lang] ) ) {
- $this->error( "Language $lang not found in Names.php",
true );
+ $this->fatalError( "Language $lang not found in
Names.php" );
}
$name = $languageNames[$lang];
diff --git a/bug-53687/fixOrphans.php b/bug-53687/fixOrphans.php
index b21644e..aed77e4 100644
--- a/bug-53687/fixOrphans.php
+++ b/bug-53687/fixOrphans.php
@@ -18,8 +18,7 @@
$fileName = $this->getArg( 0 );
$f = fopen( $fileName, 'r' );
if ( !$f ) {
- $this->error( "Unable to open list file \"$fileName\""
);
- exit( 1 );
+ $this->fatalError( "Unable to open list file
\"$fileName\"" );
}
$lineNumber = 0;
$dryRun = $this->getOption( 'dry-run' );
diff --git a/changeSkinPref.php b/changeSkinPref.php
index 1de1005..47ba184 100644
--- a/changeSkinPref.php
+++ b/changeSkinPref.php
@@ -47,10 +47,10 @@
$user = User::newFromName( $userName );
$wiki = wfWikiID();
if ( !$user || $user->getId() === 0 ) {
- $this->error( "User $userName does not exist or is
invalid.", 1 );
+ $this->fatalError( "User $userName does not exist or is
invalid." );
}
if ( !array_key_exists( $newSkin, Skin::getSkinNames() ) ) {
- $this->error( "$newSkin is not a valid skin", 1 );
+ $this->fatalError( "$newSkin is not a valid skin" );
}
$skin = $user->getOption( 'skin' );
if ( $skin === $newSkin ) {
diff --git a/cleanupBug41615.php b/cleanupBug41615.php
index 2d5bcac..d478a00 100644
--- a/cleanupBug41615.php
+++ b/cleanupBug41615.php
@@ -24,7 +24,7 @@
$logFile = $this->getOption( 'logdir' ) . "/$wgDBname";
if ( !file_put_contents( $logFile, "STARTED " . wfTimestamp() .
"\n", FILE_APPEND ) ) {
- $this->error( "Could not write to log file", 1 ); // die
+ $this->fatalError( "Could not write to log file" );
}
# Mangle throw the log as log_comment can have newlines and
such...
@@ -49,7 +49,7 @@
}
if ( ( count( $binlog ) % 2 ) != 0 ) {
- $this->error( "Binlog dump entries not matched up.\n",
1 );
+ $this->fatalError( "Binlog dump entries not matched
up.\n" );
}
$binlog = array_chunk( $binlog, 2 ); // there should be pairs
of corresponding logs
@@ -60,7 +60,7 @@
// 1351692955 itwiki DELETE /*
WikiPage::doDeleteArticleReal Guidomac */
// FROM `page` WHERE page_id = '4258611'
if ( !preg_match( "!^\d+ (\w+) DELETE .* WHERE page_id
= '(\d+)'!", $dEntry, $m ) ) {
- $this->error( "Could not parse '$dEntry'.", 1 );
+ $this->fatalError( "Could not parse '$dEntry'."
);
}
$info = [ 'wiki' => $m[1], 'page_id' => $m[2] ];
// 1351692955 itwiki INSERT /* ManualLogEntry::insert
Guidomac */ INTO `logging`
@@ -68,7 +68,7 @@
// VALUES
(NULL,'delete','delete','20121031141555','276491','Guidomac','0','Doesn\'t_Matter','0','([[WP:IMMEDIATA|C1]])
Pagina o sottopagina vuota, di prova, senza senso o tautologica','a:0:{}')
$et = "(?:[^']|\')*"; // single-quote escaped item
if ( !preg_match( "! VALUES
\(NULL,'delete','delete','\d+','\d+','$et','(\d+)','($et)','\d','$et','$et'\)!m",
$iEntry, $m ) ) {
- $this->error( "Could not parse '$iEntry'.", 1 );
+ $this->fatalError( "Could not parse '$iEntry'."
);
}
$info['log_namespace'] = $m[1];
$info['log_title'] = str_replace( "\'", "'", $m[2] );
// unescape
@@ -115,7 +115,7 @@
}
// Log the upcoming UPDATE
if ( !file_put_contents( $logFile,
"{$info['page_id']} => $newID\n", FILE_APPEND ) ) {
- $this->error( "Could not write to log
file", 1 ); // die
+ $this->fatalError( "Could not write to
log file" );
}
if ( $this->hasOption( 'fix' ) ) {
$dbw->update( 'revision',
diff --git a/createExtensionTables.php b/createExtensionTables.php
index 01d7fcd..6a8f707 100644
--- a/createExtensionTables.php
+++ b/createExtensionTables.php
@@ -67,7 +67,7 @@
case 'flow':
if ( $wgFlowDefaultWikiDb !== false ) {
- $this->error( "This wiki uses
$wgFlowDefaultWikiDb for Flow tables. They don't need to be created on the
project database, which is the scope of this script.", 1 );
+ $this->fatalError( "This wiki uses
$wgFlowDefaultWikiDb for Flow tables. They don't need to be created on the
project database, which is the scope of this script." );
}
$files = [ 'flow.sql' ];
$path = "$IP/extensions/Flow";
@@ -146,7 +146,7 @@
break;
default:
- $this->error( "This script is not configured to
create tables for $extension\n", 1 );
+ $this->fatalError( "This script is not
configured to create tables for $extension\n" );
}
$this->output( "Creating $extension tables..." );
diff --git a/dumpInterwiki.php b/dumpInterwiki.php
index 49ed193..f57719a 100644
--- a/dumpInterwiki.php
+++ b/dumpInterwiki.php
@@ -247,7 +247,7 @@
try {
$this->dbFile = CdbWriter::open(
$this->getOption( 'o' ) );
} catch ( CdbException $e ) {
- $this->error( "Unable to open cdb file for
writing", 1 );
+ $this->fatalError( "Unable to open cdb file for
writing" );
}
} else {
$this->output( "<?php\n" );
@@ -293,7 +293,7 @@
$lines = array_map( 'trim', explode( "\n", trim( $intermap ) )
);
if ( !$lines || count( $lines ) < 2 ) {
- $this->error( "m:Interwiki_map not found", true );
+ $this->fatalError( "m:Interwiki_map not found" );
}
// Global interwiki map
diff --git a/getJobQueueLengths.php b/getJobQueueLengths.php
index 84c6b3e..67d4de6 100644
--- a/getJobQueueLengths.php
+++ b/getJobQueueLengths.php
@@ -20,8 +20,7 @@
function execute() {
if ( $this->hasOption( 'grouponly' ) && $this->hasOption(
'report' ) ) {
- $this->error( "You cannot specify both '--report' and
'--grouponly'.\n" );
- exit( 1 );
+ $this->fatalError( "You cannot specify both '--report'
and '--grouponly'." );
}
$totalOnly = $this->hasOption( 'totalonly' );
diff --git a/getPageCounts.php b/getPageCounts.php
index 0b8698a..5767b30 100644
--- a/getPageCounts.php
+++ b/getPageCounts.php
@@ -47,7 +47,7 @@
$dbr = $lb->getConnection( DB_REPLICA, [], $wiki );
$row = $dbr->selectRow( 'site_stats', [
'ss_total_pages', 'ss_good_articles' ], '', __METHOD__ );
if ( !$row ) {
- $this->error( "Error: '$wiki' has empty
site_stats\n", 1 ); // Die
+ $this->fatalError( "Error: '$wiki' has empty
site_stats" );
}
$counts[$wiki] = [
'pages' => intval( $row->ss_total_pages ),
diff --git a/removeDeletedWikis.php b/removeDeletedWikis.php
index aafecf9..07ffe81 100644
--- a/removeDeletedWikis.php
+++ b/removeDeletedWikis.php
@@ -33,7 +33,7 @@
function execute() {
$wikis = file( '/srv/mediawiki/dblists/deleted.dblist' );
if ( $wikis === false ) {
- $this->error( 'Unable to open deleted.dblist', 1 );
+ $this->fatalError( 'Unable to open deleted.dblist' );
}
$dbw = $this->getDB( DB_MASTER );
@@ -58,7 +58,7 @@
*/
function doDeletes( $dbw, $table, $column, $wiki ) {
if ( !$dbw->tableExists( $table ) ) {
- $this->error( "Maintenance script cannot be run on this
wiki as there is no $table table", 1 );
+ $this->fatalError( "Maintenance script cannot be run on
this wiki as there is no $table table" );
}
$this->output( "$table:\n" );
$count = 0;
--
To view, visit https://gerrit.wikimedia.org/r/392365
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0d53b8fe1cb1a8b9d25d6375b73b40621b4b570c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMaintenance
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits