MediaWiki
master
TransactionIdentifier.php
Go to the documentation of this file.
1
<?php
20
namespace
Wikimedia\Rdbms
;
21
22
use Stringable;
23
30
class
TransactionIdentifier
implements
Stringable {
32
private
$id =
''
;
33
34
public
function
__construct
() {
35
static
$nextId;
36
$nextId = ( $nextId !==
null
? $nextId++ : mt_rand() ) % 0xffff;
37
$this->
id
= sprintf(
'%06x'
, mt_rand( 0, 0xffffff ) ) . sprintf(
'%04x'
, $nextId );
38
}
39
40
public
function
__toString
() {
41
return
$this->id;
42
}
43
}
Wikimedia\Rdbms\TransactionIdentifier
Class used for token representing identifiers for atomic transactions from IDatabase instances.
Definition
TransactionIdentifier.php:30
Wikimedia\Rdbms\TransactionIdentifier\__construct
__construct()
Definition
TransactionIdentifier.php:34
Wikimedia\Rdbms\TransactionIdentifier\__toString
__toString()
Definition
TransactionIdentifier.php:40
Wikimedia\Rdbms
Definition
ChangedTablesTracker.php:3
includes
libs
rdbms
database
utils
TransactionIdentifier.php
Generated on Fri Nov 8 2024 21:24:33 for MediaWiki by
1.10.0