MediaWiki REL1_39
TransactionIdentifier.php
Go to the documentation of this file.
1<?php
20namespace Wikimedia\Rdbms;
21
30 private $id = '';
31
32 public function __construct() {
33 static $nextId;
34 $nextId = ( $nextId !== null ? $nextId++ : mt_rand() ) % 0xffff;
35 $this->id = sprintf( '%06x', mt_rand( 0, 0xffffff ) ) . sprintf( '%04x', $nextId );
36 }
37
38 public function __toString() {
39 return $this->id;
40 }
41}
Class used for token representing identifiers for atomic transactions from IDatabase instances.