MediaWiki master
MediaWiki\User\TempUser\DBSerialProvider Class Reference

Base class for serial acquisition code shared between core and CentralAuth. More...

Inherits MediaWiki\User\TempUser\SerialProvider.

Inherited by MediaWiki\User\TempUser\LocalSerialProvider.

Collaboration diagram for MediaWiki\User\TempUser\DBSerialProvider:

Public Member Functions

 __construct ( $config)
 
 acquireIndex (int $year=0)
 Acquire an integer such that it is unlikely to be used again, and return it.
 

Protected Member Functions

 getDB ()
 
 getTableName ()
 

Detailed Description

Base class for serial acquisition code shared between core and CentralAuth.

Since
1.39

Definition at line 13 of file DBSerialProvider.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\User\TempUser\DBSerialProvider::__construct ( $config)
Parameters
array$config
  • numShards (int, default 1): A small integer. This can be set to a value greater than 1 to avoid acquiring a global lock when allocating IDs, at the expense of making the IDs be non-monotonic.

Definition at line 23 of file DBSerialProvider.php.

Member Function Documentation

◆ acquireIndex()

MediaWiki\User\TempUser\DBSerialProvider::acquireIndex ( int $year = 0)

Acquire an integer such that it is unlikely to be used again, and return it.

Parameters
int$yearThe current year, as calculated by the caller (or 0 if the year is not being used).
Returns
int

Implements MediaWiki\User\TempUser\SerialProvider.

Definition at line 27 of file DBSerialProvider.php.

◆ getDB()

MediaWiki\User\TempUser\DBSerialProvider::getDB ( )
abstractprotected
Returns
IDatabase

Reimplemented in MediaWiki\User\TempUser\LocalSerialProvider.

◆ getTableName()

MediaWiki\User\TempUser\DBSerialProvider::getTableName ( )
abstractprotected
Returns
string

Reimplemented in MediaWiki\User\TempUser\LocalSerialProvider.


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