X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fuser%2FLocalIdLookup.php;h=0a345540ffc3445931424894334579e94c9b70fa;hb=8a95833baed3b8071fcbd8cd2bc8c3449409f665;hp=f7c54089b85375d1c8a749002dedaa2577bb3cf8;hpb=96906168cac0e9a7748511b48c369cf22c8406d5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/user/LocalIdLookup.php b/includes/user/LocalIdLookup.php index f7c54089b8..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_SLAVE ); - $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_SLAVE ); - $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' ];