38 public static function hasFlags( $bitfield, $flags ) {
39 return ( $bitfield & $flags ) == $flags;
63 $lockingOptions[] =
'FOR UPDATE';
65 $lockingOptions[] =
'LOCK IN SHARE MODE';
68 return [ $index, $lockingOptions ];
87 throw new InvalidArgumentException(
'$index must be either DB_REPLICA or DB_PRIMARY' );
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
if(!defined('MW_SETUP_CALLBACK'))
Helper class for DAO classes.
static getDBFromRecency(IConnectionProvider $dbProvider, int $recency)
static getDBOptions( $bitfield)
Get an appropriate DB index and options.
static getDBFromIndex(IConnectionProvider $dbProvider, int $index)
Takes $index from ::getDBOptions() and return proper Database object.
static hasFlags( $bitfield, $flags)
Interface for database access objects.
const READ_LOCKING
Read from the primary/quorum and lock out other writers.
const READ_LATEST
Read from the primary/quorum.
const READ_LATEST_IMMUTABLE
Read from a replica DB or without a quorum, using the primary/quorum on miss.
const READ_EXCLUSIVE
Read from the primary/quorum and lock out other writers and locking readers.