Stop calling FileRepo->streamFile()
[lhc/web/wiklou.git] / includes / user / UserNamePrefixSearch.php
index f565266..b7d5058 100644 (file)
@@ -39,17 +39,17 @@ class UserNamePrefixSearch {
        public static function search( $audience, $search, $limit, $offset = 0 ) {
                $user = User::newFromName( $search );
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $prefix = $user ? $user->getName() : '';
-               $tables = array( 'user' );
-               $cond = array( 'user_name ' . $dbr->buildLike( $prefix, $dbr->anyString() ) );
-               $joinConds = array();
+               $tables = [ 'user' ];
+               $cond = [ 'user_name ' . $dbr->buildLike( $prefix, $dbr->anyString() ) ];
+               $joinConds = [];
 
                // Filter out hidden user names
                if ( $audience === 'public' || !$audience->isAllowed( 'hideuser' ) ) {
                        $tables[] = 'ipblocks';
-                       $cond['ipb_deleted'] = array( 0, null );
-                       $joinConds['ipblocks'] = array( 'LEFT JOIN', 'user_id=ipb_user' );
+                       $cond['ipb_deleted'] = [ 0, null ];
+                       $joinConds['ipblocks'] = [ 'LEFT JOIN', 'user_id=ipb_user' ];
                }
 
                $res = $dbr->selectFieldValues(
@@ -57,14 +57,14 @@ class UserNamePrefixSearch {
                        'user_name',
                        $cond,
                        __METHOD__,
-                       array(
+                       [
                                'LIMIT' => $limit,
                                'ORDER BY' => 'user_name',
                                'OFFSET' => $offset
-                       ),
+                       ],
                        $joinConds
                );
 
-               return $res === false ? array() : $res;
+               return $res === false ? [] : $res;
        }
 }