Merge "Don't fallback from uk to ru"
[lhc/web/wiklou.git] / maintenance / refreshFileHeaders.php
index 3f1b167..e075501 100644 (file)
@@ -47,14 +47,14 @@ class RefreshFileHeaders extends Maintenance {
                $end = str_replace( ' ', '_', $this->getOption( 'end', '' ) ); // page on img_name
 
                $count = 0;
-               $dbr = $this->getDB( DB_SLAVE );
+               $dbr = $this->getDB( DB_REPLICA );
                do {
-                       $conds = array( "img_name > {$dbr->addQuotes( $start )}" );
+                       $conds = [ "img_name > {$dbr->addQuotes( $start )}" ];
                        if ( strlen( $end ) ) {
                                $conds[] = "img_name <= {$dbr->addQuotes( $end )}";
                        }
                        $res = $dbr->select( 'image', '*', $conds,
-                               __METHOD__, array( 'LIMIT' => $this->mBatchSize, 'ORDER BY' => 'img_name ASC' ) );
+                               __METHOD__, [ 'LIMIT' => $this->mBatchSize, 'ORDER BY' => 'img_name ASC' ] );
                        foreach ( $res as $row ) {
                                $file = $repo->newFileFromRow( $row );
                                $headers = $file->getStreamHeaders();
@@ -80,9 +80,9 @@ class RefreshFileHeaders extends Maintenance {
        }
 
        protected function updateFileHeaders( File $file, array $headers ) {
-               $status = $file->getRepo()->getBackend()->describe( array(
+               $status = $file->getRepo()->getBackend()->describe( [
                        'src' => $file->getPath(), 'headers' => $headers
-               ) );
+               ] );
                if ( !$status->isGood() ) {
                        $this->error( "Encountered error: " . print_r( $status, true ) );
                }