* Installation fixes for running under IIS
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 27 Mar 2005 06:37:21 +0000 (06:37 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 27 Mar 2005 06:37:21 +0000 (06:37 +0000)
$_SERVER['REQUEST_URI'] and $_SERVER['SERVER_ADMIN'] aren't set under IIS.
Fall back to $_SERVER['SCRIPT_NAME'] for determining base URL on install.

config/index.php
includes/Setup.php

index 0fbf898..331fdf4 100644 (file)
@@ -330,13 +330,16 @@ $conf->IP = dirname( dirname( __FILE__ ) );
 print "<li>Installation directory: <tt>" . htmlspecialchars( $conf->IP ) . "</tt></li>\n";
 
 # $conf->ScriptPath = "/~brion/inplace";
-$conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $_SERVER["REQUEST_URI"] );
+$conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $_SERVER["SCRIPT_NAME"] );
 print "<li>Script URI path: <tt>" . htmlspecialchars( $conf->ScriptPath ) . "</tt></li>\n";
 
        $conf->posted = ($_SERVER["REQUEST_METHOD"] == "POST");
 
        $conf->Sitename = ucfirst( importPost( "Sitename", "" ) );
-       $conf->EmergencyContact = importPost( "EmergencyContact", $_SERVER["SERVER_ADMIN"] );
+       $defaultEmail = empty( $_SERVER["SERVER_ADMIN"] )
+               ? 'root@localhost'
+               : $_SERVER["SERVER_ADMIN"];
+       $conf->EmergencyContact = importPost( "EmergencyContact", $defaultEmail );
        $conf->DBserver = importPost( "DBserver", "localhost" );
        $conf->DBname = importPost( "DBname", "wikidb" );
        $conf->DBuser = importPost( "DBuser", "wikiuser" );
index 39c3ab8..a43cfc3 100644 (file)
@@ -115,7 +115,7 @@ if ( $wgCommandLineMode ) {
                wfDebug( "$name: $value\n" );
        }
        wfDebug( "\n" );
-} else {
+} elseif( isset( $_SERVER['REQUEST_URI'] ) ) {
        wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "\n" );
 }