<?php
/**
+ * Base class for memcached clients.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
$params['timeout'] = $GLOBALS['wgMemCachedTimeout'];
}
if ( !isset( $params['connect_timeout'] ) ) {
- $params['connect_timeout'] = 0.1;
+ $params['connect_timeout'] = 0.5;
}
return $params;
}
/**
* @param $key string
* @param $value int
+ * @param $exptime int (default 0)
* @return Mixed
*/
public function add( $key, $value, $exptime = 0 ) {
* the other control characters for compatibility with libmemcached
* verify_key. We leave other punctuation alone, to maximise backwards
* compatibility.
+ * @param $key string
* @return string
*/
public function encodeKey( $key ) {
array( $this, 'encodeKeyCallback' ), $key );
}
+ /**
+ * @param $m array
+ * @return string
+ */
protected function encodeKeyCallback( $m ) {
return rawurlencode( $m[0] );
}