* Update NoLocalSettings.php for the new installer. Stop advising users to move Local...
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 6 Dec 2010 08:11:31 +0000 (08:11 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 6 Dec 2010 08:11:31 +0000 (08:11 +0000)
* Fix the installer session name to be something that makes sense, instead of my_wiki_session.

includes/installer/CoreInstaller.php
includes/templates/NoLocalSettings.php

index 8809ea2..0ad8eb6 100644 (file)
@@ -494,6 +494,9 @@ abstract class CoreInstaller extends Installer {
                // Allow multiple ob_flush() calls
                $GLOBALS['wgDisableOutputCompression'] = true;
 
+               // Use a sensible cookie prefix (not my_wiki)
+               $GLOBALS['wgCookiePrefix'] = 'mw_installer';
+
                // Some of the environment checks make shell requests, remove limits
                $GLOBALS['wgMaxShellMemory'] = 0;
        }
index 88510cc..d31b226 100644 (file)
@@ -13,6 +13,17 @@ $script = $_SERVER['SCRIPT_NAME'];
 $path = pathinfo( $script, PATHINFO_DIRNAME ) . '/';
 $path = str_replace( '//', '/', $path );
 $ext = pathinfo( $script, PATHINFO_EXTENSION );
+
+# Check to see if the installer is running
+if ( !function_exists( 'session_name' ) ) {
+       $installerStarted = false;
+} else {
+       session_name( 'mw_installer_session' );
+       $oldReporting = error_reporting( E_ALL & ~E_NOTICE );
+       $success = session_start();
+       error_reporting( $oldReporting );
+       $installerStarted = ( $success && isset( $_SESSION['installData'] ) );
+}
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns='http://www.w3.org/1999/xhtml' lang='en'>
@@ -37,13 +48,16 @@ $ext = pathinfo( $script, PATHINFO_EXTENSION );
 
                <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></h1>
                <div class='error'>
+               <p>LocalSettings.php not found.</p>
+               <p>
                <?php
-               if ( file_exists( 'config/LocalSettings.php' ) ) {
-                       echo( 'To complete the installation, move <tt>config/LocalSettings.php</tt> to the parent directory.' );
+               if ( $installerStarted ) {
+                       echo( "Please <a href=\"" . htmlspecialchars( $path ) . "config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php." );
                } else {
-                       echo( "Please <a href=\"" . htmlspecialchars( $path ) . "config/index." . htmlspecialchars( $ext ) . "\" title='setup'> set up the wiki</a> first." );
+                       echo( "Please <a href=\"" . htmlspecialchars( $path ) . "config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first." );
                }
                ?>
+               </p>
 
                </div>
        </body>