X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Flbfactory%2FLBFactory.php;h=bc428ece001822964d3428ac2f94822092370280;hp=23245530166d31c25bc830bc4b504abf0efd12c7;hb=7f24eb5d789966ec7c18c0a612fc9089229d4279;hpb=d2b5c86eac27b0ce60076502f195b1b37d762c60 diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php b/includes/libs/rdbms/lbfactory/LBFactory.php index 2324553016..bc428ece00 100644 --- a/includes/libs/rdbms/lbfactory/LBFactory.php +++ b/includes/libs/rdbms/lbfactory/LBFactory.php @@ -75,6 +75,11 @@ abstract class LBFactory implements ILBFactory { /** @var callable[] */ protected $replicationWaitCallbacks = []; + /** @var array[] $aliases Map of (table => (dbname, schema, prefix) map) */ + protected $tableAliases = []; + /** @var string[] Map of (index alias => index) */ + protected $indexAliases = []; + /** @var bool Whether this PHP instance is for a CLI script */ protected $cliMode; /** @var string Agent name for query profiling */ @@ -308,7 +313,7 @@ abstract class LBFactory implements ILBFactory { $opts += [ 'domain' => false, 'cluster' => false, - 'timeout' => 60, + 'timeout' => $this->cliMode ? 60 : 10, 'ifWritesSince' => null ]; @@ -523,6 +528,17 @@ abstract class LBFactory implements ILBFactory { if ( $this->trxRoundId !== false ) { $lb->beginMasterChanges( $this->trxRoundId ); // set DBO_TRX } + + $lb->setTableAliases( $this->tableAliases ); + $lb->setIndexAliases( $this->indexAliases ); + } + + public function setTableAliases( array $aliases ) { + $this->tableAliases = $aliases; + } + + public function setIndexAliases( array $aliases ) { + $this->indexAliases = $aliases; } public function setDomainPrefix( $prefix ) {