Merge "Setup: Avoid using count() function in any kind of loop(s)"
[lhc/web/wiklou.git] / includes / db / MWLBFactory.php
index 82d9c1d..e50f855 100644 (file)
@@ -65,6 +65,7 @@ abstract class MWLBFactory {
                        'cliMode' => $wgCommandLineMode,
                        'hostname' => wfHostname(),
                        'readOnlyReason' => $readOnlyMode->getReason(),
+                       'defaultGroup' => $mainConfig->get( 'DBDefaultGroup' ),
                ];
 
                // When making changes here, remember to also specify MediaWiki-specific options
@@ -208,10 +209,8 @@ abstract class MWLBFactory {
                return $class;
        }
 
-       public static function setSchemaAliases( LBFactory $lbFactory ) {
-               $mainLB = $lbFactory->getMainLB();
-               $masterType = $mainLB->getServerType( $mainLB->getWriterIndex() );
-               if ( $masterType === 'mysql' ) {
+       public static function setSchemaAliases( LBFactory $lbFactory, Config $config ) {
+               if ( $config->get( 'DBtype' ) === 'mysql' ) {
                        /**
                         * When SQLite indexes were introduced in r45764, it was noted that
                         * SQLite requires index names to be unique within the whole database,