Set WebInstaller session variables as globals
authorGergő Tisza <tgr.huwiki@gmail.com>
Tue, 20 Mar 2018 01:35:43 +0000 (18:35 -0700)
committerGergő Tisza <tgr.huwiki@gmail.com>
Tue, 20 Mar 2018 01:39:00 +0000 (18:39 -0700)
During the install process LocalSettings.php does not exist
yet so globals simply take their values from DefaultSettings.php.
The installer uses the correct settings directly for e.g. database
operations, but this blows up when something tries to use
MediaWikiServices which is hardcoded to work with globals.

Make the installer update the globals to work around this.

Bug: T187586
Change-Id: I042099c399bc58929e83178f61e6e6ca478a3ee6

includes/installer/WebInstaller.php

index e0e54c8..9d7e051 100644 (file)
@@ -155,6 +155,10 @@ class WebInstaller extends Installer {
 
                if ( isset( $session['settings'] ) ) {
                        $this->settings = $session['settings'] + $this->settings;
+                       // T187586 MediaWikiServices works with globals
+                       foreach ( $this->settings as $key => $val ) {
+                               $GLOBALS[$key] = $val;
+                       }
                }
 
                $this->setupLanguage();