* @ingroup Deployment
*/
+use MediaWiki\MediaWikiServices;
+
/**
* Class for the core installer web interface.
*
if ( ( $this->getVar( '_InstallDone' ) || $this->getVar( '_UpgradeDone' ) )
&& $this->request->getVal( 'localsettings' )
) {
- $this->request->response()->header( 'Content-type: application/x-httpd-php' );
- $this->request->response()->header(
- 'Content-Disposition: attachment; filename="LocalSettings.php"'
- );
-
- $ls = InstallerOverrides::getLocalSettingsGenerator( $this );
- $rightsProfile = $this->rightsProfiles[$this->getVar( '_RightsProfile' )];
- foreach ( $rightsProfile as $group => $rightsArr ) {
- $ls->setGroupRights( $group, $rightsArr );
- }
- echo $ls->getText();
-
+ $this->outputLS();
return $this->session;
}
if ( $this->getSession( 'test' ) === null && !$this->request->wasPosted() ) {
$wgLanguageCode = $this->getAcceptLanguage();
- $wgLang = $wgContLang = Language::factory( $wgLanguageCode );
+ $wgLang = Language::factory( $wgLanguageCode );
RequestContext::getMain()->setLanguage( $wgLang );
$this->setVar( 'wgLanguageCode', $wgLanguageCode );
$this->setVar( '_UserLang', $wgLanguageCode );
} else {
$wgLanguageCode = $this->getVar( 'wgLanguageCode' );
- $wgContLang = Language::factory( $wgLanguageCode );
}
+ $wgContLang = MediaWikiServices::getInstance()->getContentLanguage();
}
/**
return WebRequest::detectServer();
}
+ /**
+ * Actually output LocalSettings.php for download
+ *
+ * @suppress SecurityCheck-XSS
+ */
+ private function outputLS() {
+ $this->request->response()->header( 'Content-type: application/x-httpd-php' );
+ $this->request->response()->header(
+ 'Content-Disposition: attachment; filename="LocalSettings.php"'
+ );
+
+ $ls = InstallerOverrides::getLocalSettingsGenerator( $this );
+ $rightsProfile = $this->rightsProfiles[$this->getVar( '_RightsProfile' )];
+ foreach ( $rightsProfile as $group => $rightsArr ) {
+ $ls->setGroupRights( $group, $rightsArr );
+ }
+ echo $ls->getText();
+ }
+
/**
* Output stylesheet for web installer pages
*/