MediaWiki
REL1_40
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
{
16
private
$lb;
17
25
public
function
__construct
( $config,
ILoadBalancer
$lb ) {
26
parent::__construct( $config );
27
$this->lb = $lb;
28
}
29
30
protected
function
getDB
() {
31
return
$this->lb->getConnectionRef(
32
DB_PRIMARY
,
33
[],
34
false
,
35
// So that startAtomic() will start a commit, reducing lock time.
36
// Without this flag, the transaction will be open until the start
37
// of request shutdown. This could be omitted to reduce the
38
// connection overhead, with numShards tuned upwards to compensate.
39
ILoadBalancer::CONN_TRX_AUTOCOMMIT
40
);
41
}
42
43
protected
function
getTableName
() {
44
return
'user_autocreate_serial'
;
45
}
46
}
MediaWiki\User\TempUser\DBSerialProvider
Base class for serial acquisition code shared between core and CentralAuth.
Definition
DBSerialProvider.php:12
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:25
MediaWiki\User\TempUser\LocalSerialProvider\getDB
getDB()
Definition
LocalSerialProvider.php:30
MediaWiki\User\TempUser\LocalSerialProvider\getTableName
getTableName()
Definition
LocalSerialProvider.php:43
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 Thu Jun 27 2024 14:04:32 for MediaWiki by
1.10.0