}
// Set various default paths sensibly...
+
if ( $wgScript === false ) {
$wgScript = "$wgScriptPath/index$wgScriptExtension";
}
&& isset( $wgFooterIcons['poweredby']['mediawiki'] )
&& $wgFooterIcons['poweredby']['mediawiki']['src'] === null
) {
- $wgFooterIcons['poweredby']['mediawiki']['src'] = "$wgStylePath/common/images/poweredby_mediawiki_88x31.png";
+ $wgFooterIcons['poweredby']['mediawiki']['src'] =
+ "$wgStylePath/common/images/poweredby_mediawiki_88x31.png";
}
/**
// as determined by $wgRCMaxAge.
// Note that we allow 1 link higher than the max for things like 56 days but a 60 day link.
sort( $wgRCLinkDays );
+
+ // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
for ( $i = 0; $i < count( $wgRCLinkDays ); $i++ ) {
+ // @codingStandardsIgnoreEnd
if ( $wgRCLinkDays[$i] >= $wgRCMaxAge / ( 3600 * 24 ) ) {
$wgRCLinkDays = array_slice( $wgRCLinkDays, 0, $i + 1, false );
break;
}
if ( $wgInvalidateCacheOnLocalSettingsChange ) {
+ // @codingStandardsIgnoreStart Generic.PHP.NoSilencedErrors.Discouraged - No GlobalFunction here yet.
$wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( "$IP/LocalSettings.php" ) ) );
+ // @codingStandardsIgnoreEnd
}
if ( $wgNewUserLog ) {
wfProfileOut( $fname . '-includes' );
wfProfileIn( $fname . '-defaults2' );
+
+if ( $wgCanonicalServer === false ) {
+ $wgCanonicalServer = wfExpandUrl( $wgServer, PROTO_HTTP );
+}
+
+// Set server name
+$serverParts = wfParseUrl( $wgCanonicalServer );
+if ( $wgServerName !== false ) {
+ wfWarn( '$wgServerName should be derived from $wgCanonicalServer, '
+ . 'not customized. Overwriting $wgServerName.' );
+}
+$wgServerName = $serverParts['host'];
+unset( $serverParts );
+
+// Set defaults for configuration variables
+// that are derived from the server name by default
+if ( $wgEmergencyContact === false ) {
+ $wgEmergencyContact = 'wikiadmin@' . $wgServerName;
+}
+
+if ( $wgPasswordSender === false ) {
+ $wgPasswordSender = 'apache@' . $wgServerName;
+}
+
if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
$wgSecureLogin = false;
- wfWarn( 'Secure login was enabled on a server that only supports HTTP or HTTPS. Disabling secure login.' );
+ wfWarn( 'Secure login was enabled on a server that only supports '
+ . 'HTTP or HTTPS. Disabling secure login.' );
}
// Now that GlobalFunctions is loaded, set defaults that depend
wfProfileOut( $fname . '-tempDir' );
}
-if ( $wgCanonicalServer === false ) {
- $wgCanonicalServer = wfExpandUrl( $wgServer, PROTO_HTTP );
-}
-
// $wgHTCPMulticastRouting got renamed to $wgHTCPRouting in MediaWiki 1.22
// ensure back compatibility.
if ( !$wgHTCPRouting && $wgHTCPMulticastRouting ) {
session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
}
-if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
- if ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix . 'Token'] ) ) {
- wfSetupSession();
- $wgSessionStarted = true;
- } else {
- $wgSessionStarted = false;
- }
+if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode &&
+ ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix . 'Token'] ) )
+) {
+ wfSetupSession();
}
wfProfileOut( $fname . '-session' );