r77862 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77861‎ | r77862 | r77863 >
Date:08:11, 6 December 2010
Author:tstarling
Status:ok
Tags:
Comment:
* Update NoLocalSettings.php for the new installer. Stop advising users to move LocalSettings.php from config/, the new installer doesn't create it. I imagine I'm not the only one with copies of LocalSettings.php lying around everywhere.
* Fix the installer session name to be something that makes sense, instead of my_wiki_session.
Modified paths:
  • /trunk/phase3/includes/installer/CoreInstaller.php (modified) (history)
  • /trunk/phase3/includes/templates/NoLocalSettings.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/CoreInstaller.php
@@ -494,6 +494,9 @@
495495 // Allow multiple ob_flush() calls
496496 $GLOBALS['wgDisableOutputCompression'] = true;
497497
 498+ // Use a sensible cookie prefix (not my_wiki)
 499+ $GLOBALS['wgCookiePrefix'] = 'mw_installer';
 500+
498501 // Some of the environment checks make shell requests, remove limits
499502 $GLOBALS['wgMaxShellMemory'] = 0;
500503 }
Index: trunk/phase3/includes/templates/NoLocalSettings.php
@@ -13,6 +13,17 @@
1414 $path = pathinfo( $script, PATHINFO_DIRNAME ) . '/';
1515 $path = str_replace( '//', '/', $path );
1616 $ext = pathinfo( $script, PATHINFO_EXTENSION );
 17+
 18+# Check to see if the installer is running
 19+if ( !function_exists( 'session_name' ) ) {
 20+ $installerStarted = false;
 21+} else {
 22+ session_name( 'mw_installer_session' );
 23+ $oldReporting = error_reporting( E_ALL & ~E_NOTICE );
 24+ $success = session_start();
 25+ error_reporting( $oldReporting );
 26+ $installerStarted = ( $success && isset( $_SESSION['installData'] ) );
 27+}
1728 ?>
1829 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1930 <html xmlns='http://www.w3.org/1999/xhtml' lang='en'>
@@ -37,13 +48,16 @@
3849
3950 <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></h1>
4051 <div class='error'>
 52+ <p>LocalSettings.php not found.</p>
 53+ <p>
4154 <?php
42 - if ( file_exists( 'config/LocalSettings.php' ) ) {
43 - echo( 'To complete the installation, move <tt>config/LocalSettings.php</tt> to the parent directory.' );
 55+ if ( $installerStarted ) {
 56+ echo( "Please <a href=\"" . htmlspecialchars( $path ) . "config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php." );
4457 } else {
45 - echo( "Please <a href=\"" . htmlspecialchars( $path ) . "config/index." . htmlspecialchars( $ext ) . "\" title='setup'> set up the wiki</a> first." );
 58+ echo( "Please <a href=\"" . htmlspecialchars( $path ) . "config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first." );
4659 }
4760 ?>
 61+ </p>
4862
4963 </div>
5064 </body>

Status & tagging log