From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- includes/objectcache/MemcachedBagOStuff.php | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'includes/objectcache/MemcachedBagOStuff.php') diff --git a/includes/objectcache/MemcachedBagOStuff.php b/includes/objectcache/MemcachedBagOStuff.php index 813c2727..3f1fa3a0 100644 --- a/includes/objectcache/MemcachedBagOStuff.php +++ b/includes/objectcache/MemcachedBagOStuff.php @@ -57,10 +57,11 @@ class MemcachedBagOStuff extends BagOStuff { /** * @param $key string + * @param $casToken[optional] mixed * @return Mixed */ - public function get( $key ) { - return $this->client->get( $this->encodeKey( $key ) ); + public function get( $key, &$casToken = null ) { + return $this->client->get( $this->encodeKey( $key ), $casToken ); } /** @@ -74,6 +75,18 @@ class MemcachedBagOStuff extends BagOStuff { $this->fixExpiry( $exptime ) ); } + /** + * @param $key string + * @param $casToken mixed + * @param $value + * @param $exptime int + * @return bool + */ + public function cas( $casToken, $key, $value, $exptime = 0 ) { + return $this->client->cas( $casToken, $this->encodeKey( $key ), + $value, $this->fixExpiry( $exptime ) ); + } + /** * @param $key string * @param $time int @@ -86,7 +99,7 @@ class MemcachedBagOStuff extends BagOStuff { /** * @param $key string * @param $value int - * @param $exptime int (default 0) + * @param int $exptime (default 0) * @return Mixed */ public function add( $key, $value, $exptime = 0 ) { @@ -101,7 +114,7 @@ class MemcachedBagOStuff extends BagOStuff { * @return Mixed */ public function replace( $key, $value, $exptime = 0 ) { - return $this->client->replace( $this->encodeKey( $key ), $value, + return $this->client->replace( $this->encodeKey( $key ), $value, $this->fixExpiry( $exptime ) ); } @@ -166,15 +179,9 @@ class MemcachedBagOStuff extends BagOStuff { * Send a debug message to the log */ protected function debugLog( $text ) { - global $wgDebugLogGroups; - if( !isset( $wgDebugLogGroups['memcached'] ) ) { - # Prefix message since it will end up in main debug log file - $text = "memcached: $text"; - } if ( substr( $text, -1 ) !== "\n" ) { $text .= "\n"; } wfDebugLog( 'memcached', $text ); } } - -- cgit v1.2.2