X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrollbackEdits.php;h=ca9abb1ce3a2fbc9df6dd46eede93e888e6d71aa;hb=08edb27f6ce31c676660a4ef89b87da79bde2cc2;hp=a2ddb93379d65773c6940cf94c0ddce62d96bf87;hpb=829b2e7d0169ba977cec42df6ee83eb60de51045;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rollbackEdits.php b/maintenance/rollbackEdits.php index a2ddb93379..ca9abb1ce3 100644 --- a/maintenance/rollbackEdits.php +++ b/maintenance/rollbackEdits.php @@ -50,13 +50,13 @@ class RollbackEdits extends Maintenance { $user = $this->getOption( 'user' ); $username = User::isIP( $user ) ? $user : User::getCanonicalName( $user ); if ( !$username ) { - $this->error( 'Invalid username', true ); + $this->fatalError( 'Invalid username' ); } $bot = $this->hasOption( 'bot' ); $summary = $this->getOption( 'summary', $this->mSelf . ' mass rollback' ); - $titles = array(); - $results = array(); + $titles = []; + $results = []; if ( $this->hasOption( 'titles' ) ) { foreach ( explode( '|', $this->getOption( 'titles' ) ) as $title ) { $t = Title::newFromText( $title ); @@ -76,7 +76,7 @@ class RollbackEdits extends Maintenance { return; } - $doer = User::newSystemUser( 'Maintenance script', array( 'steal' => true ) ); + $doer = User::newSystemUser( 'Maintenance script', [ 'steal' => true ] ); foreach ( $titles as $t ) { $page = WikiPage::factory( $t ); @@ -95,12 +95,12 @@ class RollbackEdits extends Maintenance { * @return array */ private function getRollbackTitles( $user ) { - $dbr = $this->getDB( DB_SLAVE ); - $titles = array(); + $dbr = $this->getDB( DB_REPLICA ); + $titles = []; $results = $dbr->select( - array( 'page', 'revision' ), - array( 'page_namespace', 'page_title' ), - array( 'page_latest = rev_id', 'rev_user_text' => $user ), + [ 'page', 'revision' ], + [ 'page_namespace', 'page_title' ], + [ 'page_latest = rev_id', 'rev_user_text' => $user ], __METHOD__ ); foreach ( $results as $row ) {