From 1b24fc40704f007f700f89887b210e7c4055d2bc Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 7 Dec 2010 02:01:07 +0000 Subject: [PATCH] * Pop up a download box for LocalSettings.php when the user goes to page=Complete. Committing for review: I'm not wedded to the concept, but we do need some way of making sure users download that file. * Fix MIME type on LocalSettings.php download to not be something that IE considers ambiguous. In Firefox, this makes it say "which is a: PHP file" instead of "plain text document" in the download dialog box. --- includes/installer/WebInstaller.php | 2 +- includes/installer/WebInstallerPage.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 9d223eb483..ec23b0f393 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -121,7 +121,7 @@ class WebInstaller extends CoreInstaller { if( ( $this->getVar( '_InstallDone' ) || $this->getVar( '_UpgradeDone' ) ) && $this->request->getVal( 'localsettings' ) ) { - $this->request->response()->header( 'Content-type: text/plain' ); + $this->request->response()->header( 'Content-type: application/x-httpd-php' ); $this->request->response()->header( 'Content-Disposition: attachment; filename="LocalSettings.php"' ); diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index be2a780b35..7118dab864 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -940,11 +940,16 @@ class WebInstaller_Install extends WebInstallerPage { class WebInstaller_Complete extends WebInstallerPage { public function execute() { + // Pop up a dialog box, to make it difficult for the user to forget + // to download the file + $lsUrl = $GLOBALS['wgServer'] . $this->parent->getURL( array( 'localsettings' => 1 ) ); + $this->parent->request->response()->header( "Refresh: 0;$lsUrl" ); + $this->startForm(); $this->addHTML( $this->parent->getInfoBox( wfMsgNoTrans( 'config-install-done', - $GLOBALS['wgServer'] . $this->parent->getURL( array( 'localsettings' => 1 ) ), + $lsUrl, $GLOBALS['wgServer'] . $this->getVar( 'wgScriptPath' ) . '/index' . $this->getVar( 'wgScriptExtension' ) -- 2.20.1