);
if ( !$status->isGood() ) {
- $this->fatalError( $status->getWikiText( null, null, 'en' ) );
+ $this->fatalError( $status->getMessage( false, false, 'en' )->text() );
}
$this->output( "$tag was created.\n" );
if ( $status->isGood() ) {
$this->output( "Password set for " . $user->getName() . "\n" );
} else {
- $this->fatalError( $status->getWikiText( null, null, 'en' ) );
+ $this->fatalError( $status->getMessage( false, false, 'en' )->text() );
}
}
}
$mp = MediaWikiServices::getInstance()->getMovePageFactory()
->newMovePage( $current, $target );
$status = $mp->move( $this->user, $reason, $createRedirect );
- $ok = $status->isOK() ? 'OK' : $status->getWikiText( false, false, 'en' );
+ $ok = $status->isOK() ? 'OK' : $status->getMessage( false, false, 'en' )->text();
$this->output( "\"$display\" -> \"$targetDisplay\": $ok\n" );
}
// Note: prepare() is usually fast for key/value backends
$status = $dst->prepare( [ 'dir' => dirname( $dstPath ), 'bypassReadOnly' => 1 ] );
if ( !$status->isOK() ) {
- $this->error( print_r( Status::wrap( $status )->getWikiText(), true ) );
+ $this->error( Status::wrap( $status )->getMessage( false, false, 'en' )->text() );
$this->fatalError( "$domainId: Could not copy $srcPath to $dstPath." );
}
$ops[] = [ 'op' => 'store',
}
$elapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 );
if ( !$status->isOK() ) {
- $this->error( print_r( Status::wrap( $status )->getWikiText(), true ) );
+ $this->error( Status::wrap( $status )->getMessage( false, false, 'en' )->text() );
$this->fatalError( "$domainId: Could not copy file batch." );
} elseif ( count( $copiedRel ) ) {
$this->output( "\n\tCopied these file(s) [{$elapsed_ms}ms]:\n\t" .
}
$elapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 );
if ( !$status->isOK() ) {
- $this->error( print_r( Status::wrap( $status )->getWikiText(), true ) );
+ $this->error( Status::wrap( $status )->getMessage( false, false, 'en' )->text() );
$this->fatalError( "$domainId: Could not delete file batch." );
} elseif ( count( $deletedRel ) ) {
$this->output( "\n\tDeleted these file(s) [{$elapsed_ms}ms]:\n\t" .
false
);
if ( !$status->isGood() ) {
- $this->fatalError( $status->getWikiText( null, null, 'en' ) );
+ $this->fatalError( $status->getMessage( false, false, 'en' )->text() );
}
}
'retype' => $password,
] );
if ( !$status->isGood() ) {
- throw new PasswordError( $status->getWikiText( null, null, 'en' ) );
+ throw new PasswordError( $status->getMessage( false, false, 'en' )->text() );
}
if ( $exists ) {
$this->output( "Password set.\n" );
$exit = 1;
}
if ( !$status->isGood() ) {
- $this->output( $status->getWikiText( false, false, 'en' ) . "\n" );
+ $this->output( $status->getMessage( false, false, 'en' )->text() . "\n" );
}
exit( $exit );
}
$statusRootPage = $importer->setTargetRootPage( $this->getOption( 'rootpage' ) );
if ( !$statusRootPage->isGood() ) {
// Die here so that it doesn't print "Done!"
- $this->fatalError( $statusRootPage->getMessage()->text() );
+ $this->fatalError( $statusRootPage->getMessage( false, false, 'en' )->text() );
return false;
}
}
$archive = $image->publish( $file, $flags, $publishOptions );
if ( !$archive->isGood() ) {
$this->output( "failed. (" .
- $archive->getWikiText( false, false, 'en' ) .
+ $archive->getMessage( false, false, 'en' )->text() .
")\n" );
$failed++;
continue;
try {
$installer = InstallerOverrides::getCliInstaller( $siteName, $adminName, $this->mOptions );
} catch ( \MediaWiki\Installer\InstallException $e ) {
- $this->output( $e->getStatus()->getMessage()->text() . "\n" );
+ $this->output( $e->getStatus()->getMessage( false, false, 'en' )->text() . "\n" );
return false;
}
->newMovePage( $source, $dest );
$status = $mp->move( $wgUser, $reason, !$noredirects );
if ( !$status->isOK() ) {
- $this->output( "\nFAILED: " . $status->getWikiText( false, false, 'en' ) );
+ $this->output( "\nFAILED: " . $status->getMessage( false, false, 'en' )->text() );
}
$this->commitTransaction( $dbw, __METHOD__ );
$this->output( "\n" );