From: Aaron Schulz Date: Thu, 23 Apr 2015 22:44:19 +0000 (-0700) Subject: Automatically set $wgMainWANCache by default using $wgMainCacheType X-Git-Tag: 1.31.0-rc.0~11602^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=d61244e4f913580beda6b900d47a0450bb4a1747;p=lhc%2Fweb%2Fwiklou.git Automatically set $wgMainWANCache by default using $wgMainCacheType Change-Id: If1ad62e4d1f84e01cd4fea04c6dd568c9d290178 --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 25f62065ae..a16a1f02b6 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2170,15 +2170,15 @@ $wgMainWANCache = CACHE_NONE; $wgWANObjectCaches = array( CACHE_NONE => array( 'class' => 'WANObjectCache', - 'pool' => 'mediawiki-main-none', 'cacheId' => CACHE_NONE, + 'pool' => 'mediawiki-main-none', 'relayerConfig' => array( 'class' => 'EventRelayerNull' ) ) /* Example of a simple single data-center cache: 'memcached-php' => array( 'class' => 'WANObjectCache', - 'pool' => 'mediawiki-main-memcached', 'cacheId' => 'memcached-php', + 'pool' => 'mediawiki-main-memcached', 'relayerConfig' => array( 'class' => 'EventRelayerNull' ) ) */ diff --git a/includes/Setup.php b/includes/Setup.php index c5c16a0f39..b8139d976f 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -530,6 +530,18 @@ if ( $wgTmpDirectory === false ) { // expecting this to exist. Should be removed sometime 1.26 or later. $wgDisableCounters = true; +if ( $wgMainWANCache === false ) { + // Setup a WAN cache from $wgMainCacheType with no relayer. + // Sites using multiple datacenters can configure a relayer. + $wgMainWANCache = 'mediawiki-main-default'; + $wgWANObjectCaches[$wgMainWANCache] = array( + 'class' => 'WANObjectCache', + 'cacheId' => $wgMainCacheType, + 'pool' => 'mediawiki-main-default', + 'relayerConfig' => array( 'class' => 'EventRelayerNull' ) + ); +} + Profiler::instance()->scopedProfileOut( $ps_default2 ); $ps_misc = Profiler::instance()->scopedProfileIn( $fname . '-misc1' );