From dd6062e75e054fc459709c6a5707e6dc30d0e0cf Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sat, 19 Nov 2011 20:01:33 +0000 Subject: [PATCH] Bug 13759 - memcached predefined hashes Patch by Zac Bristow Half of the patch was already applied. Updated documentation to match --- includes/objectcache/MemcachedClient.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/includes/objectcache/MemcachedClient.php b/includes/objectcache/MemcachedClient.php index 6e17a9eff9..868ad69fe2 100644 --- a/includes/objectcache/MemcachedClient.php +++ b/includes/objectcache/MemcachedClient.php @@ -396,7 +396,7 @@ class MWMemcached { /** * Retrieves the value associated with the key from the memcache server * - * @param $key Mixed: key to retrieve + * @param $key array|string key to retrieve * * @return Mixed */ @@ -419,6 +419,7 @@ class MWMemcached { return false; } + $key = is_array( $key ) ? $key[1] : $key; if ( isset( $this->stats['get'] ) ) { $this->stats['get']++; } else { @@ -826,9 +827,9 @@ class MWMemcached { /** * Perform increment/decriment on $key * - * @param $cmd String: command to perform - * @param $key String: key to perform it on - * @param $amt Integer: amount to adjust + * @param $cmd String command to perform + * @param $key String|array key to perform it on + * @param $amt Integer amount to adjust * * @return Integer: new value of $key * @access private @@ -958,7 +959,7 @@ class MWMemcached { } else { $this->stats[$cmd] = 1; } - + // TTLs higher than 30 days will be detected as absolute TTLs // (UNIX timestamps), and will result in the cache entry being // discarded immediately because the expiry is in the past. -- 2.20.1