MediaWiki master
Wikimedia\Rdbms\Database\DatabaseFlags Class Reference

Inherits Wikimedia\Rdbms\Database\IDatabaseFlags.

Collaboration diagram for Wikimedia\Rdbms\Database\DatabaseFlags:

Public Member Functions

 __construct ( $flags)
 
 clearFlag ( $flag, $remember=self::REMEMBER_NOTHING)
 Clear a flag for this connection.
 
 getFlag ( $flag)
 Returns a boolean whether the flag $flag is set for this connection.
 
 hasApplicableImplicitTrxFlag (int $queryFlags)
 
 hasImplicitTrxFlag ()
 
 restoreFlags ( $state=self::RESTORE_PRIOR)
 Restore the flags to their prior state before the last setFlag/clearFlag call.
 
 setFlag ( $flag, $remember=self::REMEMBER_NOTHING)
 Set a flag for this connection.
 

Static Public Member Functions

static contains (int $flags, int $bit)
 

Protected Attributes

int $flags
 Current bit field of class DBO_* constants.
 

Additional Inherited Members

- Public Attributes inherited from Wikimedia\Rdbms\Database\IDatabaseFlags
const DBO_COMPRESS = 512
 Enable compression in connection protocol.
 
const DBO_DDLMODE = 128
 Schema file mode; was used by Oracle.
 
const DBO_DEBUG = 1
 Enable debug logging of all SQL queries.
 
const DBO_DEFAULT = 16
 Join load balancer transaction rounds (which control DBO_TRX) in non-CLI mode.
 
const DBO_GAUGE = 1024
 Optimize connection for guaging server state (e.g.
 
const DBO_IGNORE = 4
 Unused since 1.31.
 
const DBO_NOBUFFER = 2
 Unused since 1.34.
 
const DBO_PERSISTENT = 32
 Use DB persistent connections if possible.
 
const DBO_SSL = 256
 Enable SSL/TLS in connection protocol.
 
const DBO_SYSDBA = 64
 DBA session mode; was used by Oracle.
 
const DBO_TRX = 8
 Automatically start a transaction before running a query if none is active.
 
const REMEMBER_NOTHING = ''
 Do not remember the prior flags.
 
const REMEMBER_PRIOR = 'remember'
 Remember the prior flags.
 
const RESTORE_INITIAL = 'initial'
 Restore to the initial flag state.
 
const RESTORE_PRIOR = 'prior'
 Restore to the prior flag state.
 

Detailed Description

Access: internal
Since
1.39

Definition at line 30 of file DatabaseFlags.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Rdbms\Database\DatabaseFlags::__construct ( $flags)

Definition at line 48 of file DatabaseFlags.php.

References Wikimedia\Rdbms\Database\DatabaseFlags\$flags.

Member Function Documentation

◆ clearFlag()

Wikimedia\Rdbms\Database\DatabaseFlags::clearFlag ( $flag,
$remember = self::REMEMBER_NOTHING )

Clear a flag for this connection.

Parameters
int$flagOne of (IDatabase::DBO_DEBUG, IDatabase::DBO_TRX)
string$rememberIDatabase::REMEMBER_* constant [default: REMEMBER_NOTHING]

Implements Wikimedia\Rdbms\Database\IDatabaseFlags.

Definition at line 66 of file DatabaseFlags.php.

References Wikimedia\Rdbms\Database\DatabaseFlags\$flags.

◆ contains()

static Wikimedia\Rdbms\Database\DatabaseFlags::contains ( int $flags,
int $bit )
static
Parameters
int$flagsA bit field of flags
int$bitBit flag constant
Returns
bool Whether the bit field has the specified bit flag set

Definition at line 102 of file DatabaseFlags.php.

References Wikimedia\Rdbms\Database\DatabaseFlags\$flags.

Referenced by Wikimedia\Rdbms\Database\DatabaseFlags\hasApplicableImplicitTrxFlag().

◆ getFlag()

Wikimedia\Rdbms\Database\DatabaseFlags::getFlag ( $flag)

Returns a boolean whether the flag $flag is set for this connection.

Parameters
int$flagOne of the class IDatabase::DBO_* constants
Returns
bool

Implements Wikimedia\Rdbms\Database\IDatabaseFlags.

Definition at line 93 of file DatabaseFlags.php.

Referenced by Wikimedia\Rdbms\Database\DatabaseFlags\hasImplicitTrxFlag().

◆ hasApplicableImplicitTrxFlag()

Wikimedia\Rdbms\Database\DatabaseFlags::hasApplicableImplicitTrxFlag ( int $queryFlags)
Parameters
int$queryFlagsA bit field of ISQLPlatform::QUERY_* constants
Returns
bool Whether the implicit transaction flag is set and applies to the query flags

Definition at line 110 of file DatabaseFlags.php.

References Wikimedia\Rdbms\Database\DatabaseFlags\contains(), and Wikimedia\Rdbms\Database\DatabaseFlags\hasImplicitTrxFlag().

◆ hasImplicitTrxFlag()

Wikimedia\Rdbms\Database\DatabaseFlags::hasImplicitTrxFlag ( )
Returns
bool Whether the implicit transaction flag is set

Definition at line 122 of file DatabaseFlags.php.

References Wikimedia\Rdbms\Database\DatabaseFlags\getFlag().

Referenced by Wikimedia\Rdbms\Database\DatabaseFlags\hasApplicableImplicitTrxFlag().

◆ restoreFlags()

Wikimedia\Rdbms\Database\DatabaseFlags::restoreFlags ( $state = self::RESTORE_PRIOR)

Restore the flags to their prior state before the last setFlag/clearFlag call.

Parameters
string$stateIDatabase::RESTORE_* constant. [default: RESTORE_PRIOR]
Since
1.28

Implements Wikimedia\Rdbms\Database\IDatabaseFlags.

Definition at line 80 of file DatabaseFlags.php.

◆ setFlag()

Wikimedia\Rdbms\Database\DatabaseFlags::setFlag ( $flag,
$remember = self::REMEMBER_NOTHING )

Set a flag for this connection.

Parameters
int$flagOne of (IDatabase::DBO_DEBUG, IDatabase::DBO_TRX)
string$rememberIDatabase::REMEMBER_* constant [default: REMEMBER_NOTHING]

Implements Wikimedia\Rdbms\Database\IDatabaseFlags.

Definition at line 52 of file DatabaseFlags.php.

References Wikimedia\Rdbms\Database\DatabaseFlags\$flags.

Member Data Documentation

◆ $flags

int Wikimedia\Rdbms\Database\DatabaseFlags::$flags
protected

The documentation for this class was generated from the following file: