Various dependency injection cleanups to LoadBalancer
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 11 Sep 2016 21:57:09 +0000 (14:57 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 13 Sep 2016 23:57:30 +0000 (23:57 +0000)
commitbac2fa4503ba0627ebf1647173cd52cfbdcaff25
treeeb71a15ac1db6e5477c6bd1217e15a5e5d660428
parent402603e12f1660f480e4e5969ec3ddf921307b72
Various dependency injection cleanups to LoadBalancer

* Inject wfWikiID() and MWExceptionHandler into LoadBalancer.
* Factor out LBFactory duplication into baseLoadBalancerParams().
* Remove $wgDBtype hack. Presumably, sites with others DBs would
  not have multiple servers configured if does not work anyway.
* Make use of injected TransactionProfiler rather than calling
  Profiler::instance()->getTransactionProfiler().
* Avoid use of trivial wfSplitWikiID() function.
* Make DBConnRef enforce its arguments more strongly and
  optimize getWiki() to avoid causing a connection attempt.
* Avoid deprecated method call in LBFactory::destroyInstance().

Change-Id: If134b62d4f48cd68cb48ccbe149e72f12aa26819
includes/db/CloneDatabase.php
includes/db/DBConnRef.php
includes/db/loadbalancer/LBFactory.php
includes/db/loadbalancer/LBFactoryMulti.php
includes/db/loadbalancer/LBFactorySimple.php
includes/db/loadbalancer/LBFactorySingle.php
includes/db/loadbalancer/LoadBalancer.php