X-Git-Url: http://git.cyclocoop.org//%27http:/jquery.khurshid.com/ifixpng.php/%27?a=blobdiff_plain;f=includes%2FSetup.php;h=641f1f903035d8bb6e085155c0aaa0df06c88ec9;hb=214750d8d224fc7e79d63536915d0dbba9fe969a;hp=a51cb83c19dc6f852bc150f92b352cf969e67703;hpb=5ecb8b3ac68de658e65fe69c6b6a1c2d8b14605f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Setup.php b/includes/Setup.php index a51cb83c19..641f1f9030 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -143,6 +143,9 @@ if ( $wgScript === false ) { if ( $wgLoadScript === false ) { $wgLoadScript = "$wgScriptPath/load.php"; } +if ( $wgRestPath === false ) { + $wgRestPath = "$wgScriptPath/rest.php"; +} if ( $wgArticlePath === false ) { if ( $wgUsePathInfo ) { @@ -518,9 +521,61 @@ foreach ( LanguageCode::getNonstandardLanguageCodeMapping() as $code => $bcp47 ) // To determine the user language, use $wgLang->getCode() $wgContLanguageCode = $wgLanguageCode; +// Temporary backwards-compatibility reading of old Squid-named CDN settings as of MediaWiki 1.34, +// to support sysadmins who fail to update their settings immediately: + +if ( isset( $wgUseSquid ) ) { + // If the sysadmin is still setting a value of $wgUseSquid to true but $wgUseCdn is the default of + // false, to be safe, assume they do want this still, so enable it. + if ( !$wgUseCdn && $wgUseSquid ) { + $wgUseCdn = $wgUseSquid; + wfDeprecated( '$wgUseSquid enabled but $wgUseCdn disabled; enabling CDN functions', '1.34' ); + } +} else { + // Backwards-compatibility for extensions that read this value. + $wgUseSquid = $wgUseCdn; +} + +if ( isset( $wgSquidServers ) ) { + // If the sysadmin is still setting a value of $wgSquidServers but $wgCdnServers is the default of + // empty, to be safe, assume they do want these servers to be still used, so use them. + if ( !empty( $wgSquidServers ) && empty( $wgCdnServers ) ) { + $wgCdnServers = $wgSquidServers; + wfDeprecated( '$wgSquidServers set, $wgCdnServers empty; using them', '1.34' ); + } +} else { + // Backwards-compatibility for extensions that read this value. + $wgSquidServers = $wgCdnServers; +} + +if ( isset( $wgSquidServersNoPurge ) ) { + // If the sysadmin is still setting values in $wgSquidServersNoPurge but $wgCdnServersNoPurge is + // the default of empty, to be safe, assume they do want these servers to be still used, so use + // them. + if ( !empty( $wgSquidServersNoPurge ) && empty( $wgCdnServersNoPurge ) ) { + $wgCdnServersNoPurge = $wgSquidServersNoPurge; + wfDeprecated( '$wgSquidServersNoPurge set, $wgCdnServersNoPurge empty; using them', '1.34' ); + } +} else { + // Backwards-compatibility for extensions that read this value. + $wgSquidServersNoPurge = $wgCdnServersNoPurge; +} + +if ( isset( $wgSquidMaxage ) ) { + // If the sysadmin is still setting a value of $wgSquidMaxage and it's higher than $wgCdnMaxAge, + // to be safe, assume they want the higher (lower performance requirement) value, so use that. + if ( $wgCdnMaxAge < $wgSquidMaxage ) { + $wgCdnMaxAge = $wgSquidMaxage; + wfDeprecated( '$wgSquidMaxage set higher than $wgCdnMaxAge; using the higher value', '1.34' ); + } +} else { + // Backwards-compatibility for extensions that read this value. + $wgSquidMaxage = $wgCdnMaxAge; +} + // Easy to forget to falsify $wgDebugToolbar for static caches. // If file cache or CDN cache is on, just disable this (DWIMD). -if ( $wgUseFileCache || $wgUseSquid ) { +if ( $wgUseFileCache || $wgUseCdn ) { $wgDebugToolbar = false; } @@ -752,7 +807,9 @@ if ( $wgRequest->getCookie( 'UseDC', '' ) === 'master' ) { // Useful debug output if ( $wgCommandLineMode ) { - wfDebug( "\n\nStart command line script $self\n" ); + if ( isset( $self ) ) { + wfDebug( "\n\nStart command line script $self\n" ); + } } else { $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";