X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=blobdiff_plain;f=maintenance%2FrollbackEdits.php;h=ca9abb1ce3a2fbc9df6dd46eede93e888e6d71aa;hb=9e34eeff23fdd46a8e9bddfbab39d45eab232827;hp=a2ddb93379d65773c6940cf94c0ddce62d96bf87;hpb=b67ab9de01a2eb95875d27a26eb9c30b22edf97e;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 ) {