r77948 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77947‎ | r77948 | r77949 >
Date:02:01, 7 December 2010
Author:tstarling
Status:ok (Comments)
Tags:
Comment:
* 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.
Modified paths:
  • /trunk/phase3/includes/installer/WebInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/WebInstallerPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/WebInstaller.php
@@ -121,7 +121,7 @@
122122 if( ( $this->getVar( '_InstallDone' ) || $this->getVar( '_UpgradeDone' ) )
123123 && $this->request->getVal( 'localsettings' ) )
124124 {
125 - $this->request->response()->header( 'Content-type: text/plain' );
 125+ $this->request->response()->header( 'Content-type: application/x-httpd-php' );
126126 $this->request->response()->header(
127127 'Content-Disposition: attachment; filename="LocalSettings.php"'
128128 );
Index: trunk/phase3/includes/installer/WebInstallerPage.php
@@ -940,11 +940,16 @@
941941 class WebInstaller_Complete extends WebInstallerPage {
942942
943943 public function execute() {
 944+ // Pop up a dialog box, to make it difficult for the user to forget
 945+ // to download the file
 946+ $lsUrl = $GLOBALS['wgServer'] . $this->parent->getURL( array( 'localsettings' => 1 ) );
 947+ $this->parent->request->response()->header( "Refresh: 0;$lsUrl" );
 948+
944949 $this->startForm();
945950 $this->addHTML(
946951 $this->parent->getInfoBox(
947952 wfMsgNoTrans( 'config-install-done',
948 - $GLOBALS['wgServer'] . $this->parent->getURL( array( 'localsettings' => 1 ) ),
 953+ $lsUrl,
949954 $GLOBALS['wgServer'] .
950955 $this->getVar( 'wgScriptPath' ) . '/index' .
951956 $this->getVar( 'wgScriptExtension' )

Follow-up revisions

RevisionCommit summaryAuthorDate
r77955Modify config-install-done, hopefully this is what Chad was looking for in CR...tstarling03:15, 7 December 2010

Comments

#Comment by 😂 (talk | contribs)   02:15, 7 December 2010

config-install-done will need tweaking.

My only complaint would be that a user might have missed the download if it happened too quickly or has their download box close automatically on completion.

#Comment by MZMcBride (talk | contribs)   02:33, 7 December 2010

For the curious, the idea to download LocalSettings.php rather than write it to the "config" directory (as has been previous behavior) is discussed and justified here: http://www.mediawiki.org/w/index.php?title=New-installer_issues&diff=334526&oldid=333913

Status & tagging log