X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrollbackEdits.php;h=5ad7d4e1c4eea5ceee79260d935c1a5216eaf8d4;hb=90845301542482bd4e502221e6485a7375193529;hp=a2ddb93379d65773c6940cf94c0ddce62d96bf87;hpb=5a4fdb5b4e82fd68e200a887cac9d4e106fed0af;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rollbackEdits.php b/maintenance/rollbackEdits.php index a2ddb93379..5ad7d4e1c4 100644 --- a/maintenance/rollbackEdits.php +++ b/maintenance/rollbackEdits.php @@ -55,8 +55,8 @@ class RollbackEdits extends Maintenance { $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 ) {