add knob for persistent MC connections
authorDomas Mituzas <midom@users.mediawiki.org>
Sun, 19 Feb 2006 09:55:20 +0000 (09:55 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Sun, 19 Feb 2006 09:55:20 +0000 (09:55 +0000)
includes/DefaultSettings.php
includes/ObjectCache.php

index c2f5cb5..a11d082 100644 (file)
@@ -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
index 336e0e6..223f5ff 100644 (file)
@@ -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 );