summaryrefslogtreecommitdiff
path: root/includes/objectcache/MemcachedPeclBagOStuff.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-12-08 09:55:49 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-12-08 09:55:49 +0100
commit4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch)
treeaf68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /includes/objectcache/MemcachedPeclBagOStuff.php
parentaf4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff)
Update to MediaWiki 1.22.0
Diffstat (limited to 'includes/objectcache/MemcachedPeclBagOStuff.php')
-rw-r--r--includes/objectcache/MemcachedPeclBagOStuff.php14
1 files changed, 12 insertions, 2 deletions
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 ) {