summaryrefslogtreecommitdiff
path: root/includes/memcached-client.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2007-01-11 19:06:07 +0000
committerPierre Schmitz <pierre@archlinux.de>2007-01-11 19:06:07 +0000
commita58285fd06c8113c45377c655dd43cef6337e815 (patch)
treedfe31d3d12652352fe44890b4811eda0728faefb /includes/memcached-client.php
parent20194986f6638233732ba1fc3e838f117d3cc9ea (diff)
Aktualisierung auf MediaWiki 1.9.0
Diffstat (limited to 'includes/memcached-client.php')
-rw-r--r--includes/memcached-client.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/includes/memcached-client.php b/includes/memcached-client.php
index b1ba778a..2c5cc6be 100644
--- a/includes/memcached-client.php
+++ b/includes/memcached-client.php
@@ -451,7 +451,8 @@ class memcached
return false;
$this->stats['get_multi']++;
-
+ $sock_keys = array();
+
foreach ($keys as $key)
{
$sock = $this->get_sock($key);
@@ -697,6 +698,7 @@ class memcached
list ($ip, $port) = explode(":", $host);
$sock = false;
$timeout = $this->_connect_timeout;
+ $errno = $errstr = null;
for ($i = 0; !$sock && $i < $this->_connect_attempts; $i++) {
if ($i > 0) {
# Sleep until the timeout, in case it failed fast
@@ -740,7 +742,7 @@ class memcached
function _dead_sock ($sock)
{
$host = array_search($sock, $this->_cache_sock);
- @list ($ip, $port) = explode(":", $host);
+ @list ($ip, /* $port */) = explode(":", $host);
$this->_host_dead[$ip] = time() + 30 + intval(rand(0, 10));
$this->_host_dead[$host] = $this->_host_dead[$ip];
unset($this->_cache_sock[$host]);
@@ -849,6 +851,7 @@ class memcached
stream_set_timeout($sock, 1, 0);
$line = fgets($sock);
+ $match = array();
if (!preg_match('/^(\d+)/', $line, $match))
return null;
return $match[1];
@@ -1001,8 +1004,9 @@ class memcached
if (isset($this->_cache_sock[$host]))
return $this->_cache_sock[$host];
+ $sock = null;
$now = time();
- list ($ip, $port) = explode (":", $host);
+ list ($ip, /* $port */) = explode (":", $host);
if (isset($this->_host_dead[$host]) && $this->_host_dead[$host] > $now ||
isset($this->_host_dead[$ip]) && $this->_host_dead[$ip] > $now)
return null;