Index: branches/REL1_3/phase3/includes/DefaultSettings.php |
— | — | @@ -15,14 +15,21 @@ |
16 | 16 | $wgMetaNamespace = FALSE; # will be same as you set $wgSitename |
17 | 17 | |
18 | 18 | |
| 19 | +if( isset( $_SERVER['SERVER_NAME'] ) ) { |
| 20 | + $wgServerName = $_SERVER['SERVER_NAME']; |
| 21 | +} elseif( isset( $_SERVER['HOSTNAME'] ) ) { |
| 22 | + $wgServerName = $_SERVER['HOSTNAME']; |
| 23 | +} else { |
| 24 | + # FIXME: Fall back on... something else? |
| 25 | + $wgServerName = 'localhost'; |
| 26 | +} |
| 27 | + |
19 | 28 | # check if server use https: |
20 | 29 | $wgProto = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; |
21 | 30 | |
22 | | -if ( @$wgCommandLineMode ) { |
23 | | - $wgServer = $wgProto.'://localhost'; |
24 | | -} else { |
25 | | - $wgServer = $wgProto.'://' . $_SERVER['SERVER_NAME']; |
26 | | - if( $_SERVER['SERVER_PORT'] != 80 ) $wgServer .= ":" . $_SERVER['SERVER_PORT']; |
| 31 | +$wgServer = $wgProto.'://' . $wgServerName; |
| 32 | +if( isset( $_SERVER['SERVER_PORT'] ) && $_SERVER['SERVER_PORT'] != 80 ) { |
| 33 | + $wgServer .= ":" . $_SERVER['SERVER_PORT']; |
27 | 34 | } |
28 | 35 | unset($wgProto); |
29 | 36 | |
— | — | @@ -47,8 +54,8 @@ |
48 | 55 | $wgMathPath = "{$wgUploadPath}/math"; |
49 | 56 | $wgMathDirectory = "{$wgUploadDirectory}/math"; |
50 | 57 | $wgTmpDirectory = "{$wgUploadDirectory}/tmp"; |
51 | | -$wgEmergencyContact = 'wikiadmin@' . $_SERVER['SERVER_NAME']; |
52 | | -$wgPasswordSender = 'Wikipedia Mail <apache@' . $_SERVER['SERVER_NAME'] . '>'; |
| 58 | +$wgEmergencyContact = 'wikiadmin@' . $wgServerName; |
| 59 | +$wgPasswordSender = 'Wikipedia Mail <apache@' . $wgServerName . '>'; |
53 | 60 | |
54 | 61 | # For using a direct (authenticated) SMTP server connection. |
55 | 62 | # "host" => 'SMTP domain', "IDHost" => 'domain for MessageID', "port" => "25", "auth" => true/false, "username" => user, "password" => password |
Index: branches/REL1_3/phase3/includes/Setup.php |
— | — | @@ -31,8 +31,11 @@ |
32 | 32 | array_pop($hopips); |
33 | 33 | } |
34 | 34 | $wgIP = trim(end($hopips)); |
| 35 | +} elseif( isset( $_SERVER['REMOTE_ADDR'] ) ) { |
| 36 | + $wgIP = $_SERVER['REMOTE_ADDR']; |
35 | 37 | } else { |
36 | | - $wgIP = $_SERVER['REMOTE_ADDR']; |
| 38 | + # Running on CLI? |
| 39 | + $wgIP = '127.0.0.1'; |
37 | 40 | } |
38 | 41 | |
39 | 42 | |