MediaWiki
master
LocalSerialProvider.php
Go to the documentation of this file.
1
<?php
2
3
namespace
MediaWiki\User\TempUser
;
4
5
use
Wikimedia\Rdbms\ILoadBalancer
;
6
14
class
LocalSerialProvider
extends
DBSerialProvider
{
15
private
ILoadBalancer
$lb;
16
24
public
function
__construct
( $config,
ILoadBalancer
$lb ) {
25
parent::__construct( $config );
26
$this->lb = $lb;
27
}
28
29
protected
function
getDB
() {
30
return
$this->lb->getConnection(
31
DB_PRIMARY
,
32
[],
33
false
,
34
// So that startAtomic() will start a commit, reducing lock time.
35
// Without this flag, the transaction will be open until the start
36
// of request shutdown. This could be omitted to reduce the
37
// connection overhead, with numShards tuned upwards to compensate.
38
ILoadBalancer::CONN_TRX_AUTOCOMMIT
39
);
40
}
41
42
protected
function
getTableName
() {
43
return
'user_autocreate_serial'
;
44
}
45
}
MediaWiki\User\TempUser\DBSerialProvider
Base class for serial acquisition code shared between core and CentralAuth.
Definition
DBSerialProvider.php:13
MediaWiki\User\TempUser\LocalSerialProvider
A serial provider which allocates IDs from the local database, or from a shared database if $wgShared...
Definition
LocalSerialProvider.php:14
MediaWiki\User\TempUser\LocalSerialProvider\__construct
__construct( $config, ILoadBalancer $lb)
Definition
LocalSerialProvider.php:24
MediaWiki\User\TempUser\LocalSerialProvider\getDB
getDB()
Definition
LocalSerialProvider.php:29
MediaWiki\User\TempUser\LocalSerialProvider\getTableName
getTableName()
Definition
LocalSerialProvider.php:42
Wikimedia\Rdbms\ILoadBalancer
This class is a delegate to ILBFactory for a given database cluster.
Definition
ILoadBalancer.php:113
MediaWiki\User\TempUser
Definition
CreateStatus.php:3
DB_PRIMARY
const DB_PRIMARY
Definition
defines.php:28
includes
user
TempUser
LocalSerialProvider.php
Generated on Sun Sep 15 2024 13:26:03 for MediaWiki by
1.10.0