After
b873e929, when the CLI installation failed, the script will throw
a ServiceDisabledException.
This is because the installer disables DBLoadBalancerFactory service
during instantiation and throws the exception because the installation
failed to restore the service.
So I check if the service is enabled before try commit
the master changes.
Bug: T229601
Change-Id: Ia7589d14ee55bcb03a64856b6dd2c81d8bda783c
(cherry picked from commit
eadde762b03ed94c687788ed3e0d9c65e5046fb2)
// Potentially debug globals
$maintenance->globals();
-if ( $maintenance->getDbType() !== Maintenance::DB_NONE ) {
+if ( $maintenance->getDbType() !== Maintenance::DB_NONE &&
+ // Service might be disabled, e.g. when running install.php
+ !MediaWikiServices::getInstance()->isServiceDisabled( 'DBLoadBalancerFactory' )
+) {
// Perform deferred updates.
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$lbFactory->commitMasterChanges( $maintClass );