Load installer i18n when running update.php
[lhc/web/wiklou.git] / maintenance / update.php
index e60efdb..2a1feb4 100755 (executable)
@@ -85,7 +85,7 @@ class UpdateMediaWiki extends Maintenance {
        }
 
        function execute() {
-               global $wgVersion, $wgLang, $wgAllowSchemaUpdates;
+               global $wgVersion, $wgLang, $wgAllowSchemaUpdates, $wgMessagesDirs;
 
                if ( !$wgAllowSchemaUpdates
                        && !( $this->hasOption( 'force' )
@@ -111,6 +111,9 @@ class UpdateMediaWiki extends Maintenance {
                        }
                }
 
+               // T206765: We need to load the installer i18n files as some of errors come installer/updater code
+               $wgMessagesDirs['MediawikiInstaller'] = dirname( __DIR__ ) . '/includes/installer/i18n';
+
                $lang = Language::factory( 'en' );
                // Set global language to ensure localised errors are in English (T22633)
                RequestContext::getMain()->setLanguage( $lang );
@@ -131,7 +134,7 @@ class UpdateMediaWiki extends Maintenance {
 
                // Check external dependencies are up to date
                if ( !$this->hasOption( 'skip-external-dependencies' ) ) {
-                       $composerLockUpToDate = $this->runChild( 'CheckComposerLockUpToDate' );
+                       $composerLockUpToDate = $this->runChild( CheckComposerLockUpToDate::class );
                        $composerLockUpToDate->execute();
                } else {
                        $this->output(
@@ -233,13 +236,13 @@ class UpdateMediaWiki extends Maintenance {
                # This needs to be disabled early since extensions will try to use the l10n
                # cache from $wgExtensionFunctions (T22471)
                $wgLocalisationCacheConf = [
-                       'class' => 'LocalisationCache',
-                       'storeClass' => 'LCStoreNull',
+                       'class' => LocalisationCache::class,
+                       'storeClass' => LCStoreNull::class,
                        'storeDirectory' => false,
                        'manualRecache' => false,
                ];
        }
 }
 
-$maintClass = 'UpdateMediaWiki';
+$maintClass = UpdateMediaWiki::class;
 require_once RUN_MAINTENANCE_IF_MAIN;