Merge "Avoid master queries on SpecialBlockList"
[lhc/web/wiklou.git] / includes / objectcache / MemcachedBagOStuff.php
index 6a98a8a..83bee70 100644 (file)
@@ -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.