From e86273163e7f1214b152859ddcc800f27f03c377 Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Sun, 19 Feb 2006 09:55:20 +0000 Subject: [PATCH] add knob for persistent MC connections --- includes/DefaultSettings.php | 1 + includes/ObjectCache.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index c2f5cb51c9..a11d082ac8 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -539,6 +539,7 @@ $wgUseMemCached = false; $wgMemCachedDebug = false; # Will be set to false in Setup.php, if the server isn't working $wgMemCachedServers = array( '127.0.0.1:11000' ); $wgMemCachedDebug = false; +$wgMemCachedPersistent = false; /** * Directory for local copy of message cache, for use in addition to memcached diff --git a/includes/ObjectCache.php b/includes/ObjectCache.php index 336e0e67fc..223f5ffd5e 100644 --- a/includes/ObjectCache.php +++ b/includes/ObjectCache.php @@ -35,7 +35,7 @@ $wgCaches = array(); /** @todo document */ function &wfGetCache( $inputType ) { - global $wgCaches, $wgMemCachedServers, $wgMemCachedDebug; + global $wgCaches, $wgMemCachedServers, $wgMemCachedDebug, $wgMemCachedPersistent; $cache = false; if ( $inputType == CACHE_ANYTHING ) { @@ -61,7 +61,7 @@ function &wfGetCache( $inputType ) { } $wgCaches[CACHE_DB] = new MemCachedClientforWiki( - array('persistant' => false, 'compress_threshold' => 1500 ) ); + array('persistant' => $wgMemCachedPersistent, 'compress_threshold' => 1500 ) ); $cache =& $wgCaches[CACHE_DB]; $cache->set_servers( $wgMemCachedServers ); $cache->set_debug( $wgMemCachedDebug ); -- 2.20.1