[MediaWiki-commits] [Gerrit] mediawiki...WikimediaMaintenance[master]: Update for Maintenance::error( $err, $die ) deprecation
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
[MediaWiki-commits] [Gerrit] mediawiki...WikimediaMaintenance[master]: Update for Maintenance::error( $err, $die ) deprecation
BryanDavis has uploaded a new change for review. ( 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(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance refs/changes/65/392365/1 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]])