- $err = $source->moveTo( $dest, false, $reason, !$noredirects );
- if ( $err !== true ) {
- $msg = array_shift( $err[0] );
- $this->output( "\nFAILED: " . wfMessage( $msg, $err[0] )->text() );
+ $mp = new MovePage( $source, $dest );
+ $status = $mp->move( $wgUser, $reason, !$noredirects );
+ if ( !$status->isOK() ) {
+ $this->output( "\nFAILED: " . $status->getWikiText() );