Remove deprecated Language::GetLanguageName()
[lhc/web/wiklou.git] / maintenance / update.php
index 06e947c..ed8dfa9 100755 (executable)
@@ -112,7 +112,10 @@ class UpdateMediaWiki extends Maintenance {
                        }
                }
 
-               $wgLang = Language::factory( 'en' );
+               $lang = Language::factory( 'en' );
+               // Set global language to ensure localised errors are in English (bug 20633)
+               RequestContext::getMain()->setLanguage( $lang );
+               $wgLang = $lang; // BackCompat
 
                define( 'MW_UPDATER', true );
 
@@ -157,7 +160,7 @@ class UpdateMediaWiki extends Maintenance {
 
                $shared = $this->hasOption( 'doshared' );
 
-               $updates = array( 'core', 'extensions' );
+               $updates = [ 'core', 'extensions' ];
                if ( !$this->hasOption( 'schema' ) ) {
                        if ( $this->hasOption( 'noschema' ) ) {
                                $updates[] = 'noschema';
@@ -191,7 +194,7 @@ class UpdateMediaWiki extends Maintenance {
 
                $time2 = microtime( true );
 
-               $timeDiff = $wgLang->formatTimePeriod( $time2 - $time1 );
+               $timeDiff = $lang->formatTimePeriod( $time2 - $time1 );
                $this->output( "\nDone in $timeDiff.\n" );
        }
 
@@ -201,12 +204,12 @@ class UpdateMediaWiki extends Maintenance {
                # Don't try to access the database
                # This needs to be disabled early since extensions will try to use the l10n
                # cache from $wgExtensionFunctions (bug 20471)
-               $wgLocalisationCacheConf = array(
+               $wgLocalisationCacheConf = [
                        'class' => 'LocalisationCache',
                        'storeClass' => 'LCStoreNull',
                        'storeDirectory' => false,
                        'manualRecache' => false,
-               );
+               ];
        }
 }