* @file
* @ingroup Deployment
*/
+use MediaWiki\MediaWikiServices;
require_once __DIR__ . '/../../maintenance/Maintenance.php';
/**
* Handle to the database subclass
*
- * @var DatabaseBase
+ * @var Database
*/
protected $db;
/**
* Constructor
*
- * @param DatabaseBase $db To perform updates on
+ * @param Database $db To perform updates on
* @param bool $shared Whether to perform updates on shared tables
* @param Maintenance $maintenance Maintenance object which created us
*/
- protected function __construct( DatabaseBase &$db, $shared, Maintenance $maintenance = null ) {
+ protected function __construct( Database &$db, $shared, Maintenance $maintenance = null ) {
$this->db = $db;
$this->db->setFlag( DBO_DDLMODE ); // For Oracle's handling of schema files
$this->shared = $shared;
/**
* Get a database connection to run updates
*
- * @return DatabaseBase
+ * @return Database
*/
public function getDB() {
return $this->db;
* @param bool $passSelf Whether to pass this object we calling external functions
*/
private function runUpdates( array $updates, $passSelf ) {
+ $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+
$updatesDone = [];
$updatesSkipped = [];
foreach ( $updates as $params ) {
flush();
if ( $ret !== false ) {
$updatesDone[] = $origParams;
- wfGetLBFactory()->waitForReplication();
+ $lbFactory->waitForReplication();
} else {
$updatesSkipped[] = [ $func, $params, $origParams ];
}