X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fuser%2FLocalIdLookup.php;h=0a345540ffc3445931424894334579e94c9b70fa;hb=3e35565c93bdafa9be2493436ebad20c4803b668;hp=0d8b1a8ede9025162b4ec5e65d37e38f5a4f4830;hpb=c118951f57e34c3133693ea56b4f1bfc3a76f473;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/user/LocalIdLookup.php b/includes/user/LocalIdLookup.php index 0d8b1a8ede..0a345540ff 100644 --- a/includes/user/LocalIdLookup.php +++ b/includes/user/LocalIdLookup.php @@ -60,10 +60,8 @@ class LocalIdLookup extends CentralIdLookup { } $audience = $this->checkAudience( $audience ); - $db = wfGetDB( ( $flags & self::READ_LATEST ) ? DB_MASTER : DB_REPLICA ); - $options = ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING ) - ? [ 'LOCK IN SHARE MODE' ] - : []; + list( $index, $options ) = DBAccessObjectUtils::getDBOptions( $flags ); + $db = wfGetDB( $index ); $tables = [ 'user' ]; $fields = [ 'user_id', 'user_name' ]; @@ -93,10 +91,8 @@ class LocalIdLookup extends CentralIdLookup { } $audience = $this->checkAudience( $audience ); - $db = wfGetDB( ( $flags & self::READ_LATEST ) ? DB_MASTER : DB_REPLICA ); - $options = ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING ) - ? [ 'LOCK IN SHARE MODE' ] - : []; + list( $index, $options ) = DBAccessObjectUtils::getDBOptions( $flags ); + $db = wfGetDB( $index ); $tables = [ 'user' ]; $fields = [ 'user_id', 'user_name' ];