Merge "Followup I4049b666: "Removing prefix exception for HTMLCheckMatrix""
[lhc/web/wiklou.git] / includes / objectcache / MemcachedPeclBagOStuff.php
index 5a96f7b..8700c8c 100644 (file)
@@ -250,8 +250,23 @@ class MemcachedPeclBagOStuff extends MemcachedBagOStuff {
                return $this->checkResult( false, $result );
        }
 
-       /* NOTE: there is no cas() method here because it is currently not supported
-        * by the BagOStuff interface and other BagOStuff subclasses, such as
-        * SqlBagOStuff.
+       /**
+        * @param array $data
+        * @param int $exptime
+        * @return bool
         */
+       public function setMulti( array $data, $exptime = 0 ) {
+               wfProfileIn( __METHOD__ );
+               foreach ( $data as $key => $value ) {
+                       $encKey = $this->encodeKey( $key );
+                       if ( $encKey !== $key ) {
+                               $data[$encKey] = $value;
+                               unset( $data[$key] );
+                       }
+               }
+               $this->debugLog( 'setMulti(' . implode( ', ', array_keys( $data ) ) . ')' );
+               $result = $this->client->setMulti( $data, $this->fixExpiry( $exptime ) );
+               wfProfileOut( __METHOD__ );
+               return $this->checkResult( false, $result );
+       }
 }