From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- includes/objectcache/MemcachedPeclBagOStuff.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'includes/objectcache/MemcachedPeclBagOStuff.php') diff --git a/includes/objectcache/MemcachedPeclBagOStuff.php b/includes/objectcache/MemcachedPeclBagOStuff.php index 31924293..0c3b228f 100644 --- a/includes/objectcache/MemcachedPeclBagOStuff.php +++ b/includes/objectcache/MemcachedPeclBagOStuff.php @@ -37,6 +37,8 @@ class MemcachedPeclBagOStuff extends MemcachedBagOStuff { * - compress_threshold: The minimum size an object must be before it is compressed * - timeout: The read timeout in microseconds * - connect_timeout: The connect timeout in seconds + * - retry_timeout: Time in seconds to wait before retrying a failed connect attempt + * - server_failure_limit: Limit for server connect failures before it is removed * - serializer: May be either "php" or "igbinary". Igbinary produces more compact * values, but serialization is much slower unless the php.ini option * igbinary.compact_strings is off. @@ -61,6 +63,14 @@ class MemcachedPeclBagOStuff extends MemcachedBagOStuff { $params['serializer'] = 'php'; } + if ( isset( $params['retry_timeout'] ) ) { + $this->client->setOption( Memcached::OPT_RETRY_TIMEOUT, $params['retry_timeout'] ); + } + + if ( isset( $params['server_failure_limit'] ) ) { + $this->client->setOption( Memcached::OPT_SERVER_FAILURE_LIMIT, $params['server_failure_limit'] ); + } + // The compression threshold is an undocumented php.ini option for some // reason. There's probably not much harm in setting it globally, for // compatibility with the settings for the PHP client. @@ -87,13 +97,13 @@ class MemcachedPeclBagOStuff extends MemcachedBagOStuff { break; case 'igbinary': if ( !Memcached::HAVE_IGBINARY ) { - throw new MWException( __CLASS__.': the igbinary extension is not available ' . + throw new MWException( __CLASS__ . ': the igbinary extension is not available ' . 'but igbinary serialization was requested.' ); } $this->client->setOption( Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_IGBINARY ); break; default: - throw new MWException( __CLASS__.': invalid value for serializer parameter' ); + throw new MWException( __CLASS__ . ': invalid value for serializer parameter' ); } $servers = array(); foreach ( $params['servers'] as $host ) { -- cgit v1.2.2