Merge "User: Avoid deprecated Linker::link()"
[lhc/web/wiklou.git] / includes / installer / Installer.php
index f03fe6a..168d7ed 100644 (file)
@@ -384,7 +384,7 @@ abstract class Installer {
 
                // make sure we use the installer config as the main config
                $configRegistry = $baseConfig->get( 'ConfigRegistry' );
-               $configRegistry['main'] = function() use ( $installerConfig ) {
+               $configRegistry['main'] = function () use ( $installerConfig ) {
                        return $installerConfig;
                };
 
@@ -446,6 +446,8 @@ abstract class Installer {
                $this->parserTitle = Title::newFromText( 'Installer' );
                $this->parserOptions = new ParserOptions( $wgUser ); // language will be wrong :(
                $this->parserOptions->setEditSection( false );
+               // Don't try to access DB before user language is initialised
+               $this->setParserLanguage( Language::factory( 'en' ) );
        }
 
        /**
@@ -674,7 +676,7 @@ abstract class Installer {
                try {
                        $out = $wgParser->parse( $text, $this->parserTitle, $this->parserOptions, $lineStart );
                        $html = $out->getText();
-               } catch ( DBAccessError $e ) {
+               } catch ( MediaWiki\Services\ServiceDisabledException $e ) {
                        $html = '<!--DB access attempted during parse-->  ' . htmlspecialchars( $text );
 
                        if ( !empty( $this->debug ) ) {
@@ -722,6 +724,7 @@ abstract class Installer {
                                'ss_good_articles' => 0,
                                'ss_total_pages' => 0,
                                'ss_users' => 0,
+                               'ss_active_users' => 0,
                                'ss_images' => 0
                        ],
                        __METHOD__, 'IGNORE'
@@ -1013,7 +1016,7 @@ abstract class Installer {
                }
 
                # Try the most common ones.
-               $commonLocales = [ 'en_US.UTF-8', 'en_US.utf8', 'de_DE.UTF-8', 'de_DE.utf8' ];
+               $commonLocales = [ 'C.UTF-8', 'en_US.UTF-8', 'en_US.utf8', 'de_DE.UTF-8', 'de_DE.utf8' ];
                foreach ( $commonLocales as $commonLocale ) {
                        if ( isset( $candidatesByLocale[$commonLocale] ) ) {
                                $this->setVar( 'wgShellLocale', $commonLocale );