diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
commit | 1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch) | |
tree | f1fdd326034e05177596851be6a7127615d81498 /includes/objectcache/MemcachedBagOStuff.php | |
parent | 9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff) | |
parent | f6d65e533c62f6deb21342d4901ece24497b433e (diff) |
Merge commit 'f6d65'
# Conflicts:
# skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'includes/objectcache/MemcachedBagOStuff.php')
-rw-r--r-- | includes/objectcache/MemcachedBagOStuff.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/includes/objectcache/MemcachedBagOStuff.php b/includes/objectcache/MemcachedBagOStuff.php index 53edcdde..83bee700 100644 --- a/includes/objectcache/MemcachedBagOStuff.php +++ b/includes/objectcache/MemcachedBagOStuff.php @@ -84,18 +84,17 @@ class MemcachedBagOStuff extends BagOStuff { * @param int $exptime * @return bool */ - public function cas( $casToken, $key, $value, $exptime = 0 ) { + protected function cas( $casToken, $key, $value, $exptime = 0 ) { return $this->client->cas( $casToken, $this->encodeKey( $key ), $value, $this->fixExpiry( $exptime ) ); } /** * @param string $key - * @param int $time * @return bool */ - public function delete( $key, $time = 0 ) { - return $this->client->delete( $this->encodeKey( $key ), $time ); + public function delete( $key ) { + return $this->client->delete( $this->encodeKey( $key ) ); } /** @@ -109,6 +108,14 @@ class MemcachedBagOStuff extends BagOStuff { $this->fixExpiry( $exptime ) ); } + public function merge( $key, $callback, $exptime = 0, $attempts = 10 ) { + if ( !is_callable( $callback ) ) { + throw new Exception( "Got invalid callback." ); + } + + return $this->mergeViaCas( $key, $callback, $exptime, $attempts ); + } + /** * Get the underlying client object. This is provided for debugging * purposes. @@ -145,7 +152,7 @@ class MemcachedBagOStuff extends BagOStuff { * 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. - * Clamp expiries >30d at 30d, unless they're >=1e9 in which + * Clamp expires >30d at 30d, unless they're >=1e9 in which * case they are likely to really be absolute (1e9 = 2011-09-09) * @param int $expiry * @return int @@ -174,6 +181,6 @@ class MemcachedBagOStuff extends BagOStuff { * @param string $text */ protected function debugLog( $text ) { - wfDebugLog( 'memcached', $text ); + $this->logger->debug( $text ); } } |