MediaWiki master
LocalSerialProvider.php
Go to the documentation of this file.
1<?php
2
4
6
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->getConnectionRef(
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}
Base class for serial acquisition code shared between core and CentralAuth.
A serial provider which allocates IDs from the local database, or from a shared database if $wgShared...
This class is a delegate to ILBFactory for a given database cluster.
const DB_PRIMARY
Definition defines.php:28