Merge "Fix some issues with Microsoft SQL Server support"
[lhc/web/wiklou.git] / includes / objectcache / BagOStuff.php
index 74af7a4..56f1be2 100644 (file)
@@ -247,6 +247,23 @@ abstract class BagOStuff {
                return $res;
        }
 
+       /**
+        * Batch insertion
+        * @param array $data $key => $value assoc array
+        * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
+        * @return bool success
+        * @since 1.24
+        */
+       public function setMulti( array $data, $exptime = 0 ) {
+               $res = true;
+               foreach ( $data as $key => $value ) {
+                       if ( !$this->set( $key, $value, $exptime ) ) {
+                               $res = false;
+                       }
+               }
+               return $res;
+       }
+
        /**
         * @param string $key
         * @param mixed $value