Merge "Add tests for WikiMap and WikiReference"
[lhc/web/wiklou.git] / includes / objectcache / MemcachedBagOStuff.php
index ac34570..e545aa5 100644 (file)
@@ -57,12 +57,7 @@ class MemcachedBagOStuff extends BagOStuff {
                return $params;
        }
 
-       /**
-        * @param string $key
-        * @param mixed $casToken [optional]
-        * @return mixed
-        */
-       public function get( $key, &$casToken = null ) {
+       public function get( $key, &$casToken = null, $flags = 0 ) {
                return $this->client->get( $this->encodeKey( $key ), $casToken );
        }
 
@@ -108,6 +103,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.
@@ -175,4 +178,12 @@ class MemcachedBagOStuff extends BagOStuff {
        protected function debugLog( $text ) {
                $this->logger->debug( $text );
        }
+
+       public function modifySimpleRelayEvent( array $event ) {
+               if ( array_key_exists( 'val', $event ) ) {
+                       $event['flg'] = 0; // data is not serialized nor gzipped (for memcached driver)
+               }
+
+               return $event;
+       }
 }