Merge "Move MediaHandler defaults out of global scope"
[lhc/web/wiklou.git] / includes / objectcache / SqlBagOStuff.php
index a1394c1..c48880f 100644 (file)
@@ -91,6 +91,9 @@ class SqlBagOStuff extends BagOStuff {
         */
        public function __construct( $params ) {
                parent::__construct( $params );
+
+               $this->attrMap[self::ATTR_EMULATION] = self::QOS_EMULATION_SQL;
+
                if ( isset( $params['servers'] ) ) {
                        $this->serverInfos = [];
                        $this->serverTags = [];
@@ -459,11 +462,7 @@ class SqlBagOStuff extends BagOStuff {
                return $newValue;
        }
 
-       public function merge( $key, $callback, $exptime = 0, $attempts = 10, $flags = 0 ) {
-               if ( !is_callable( $callback ) ) {
-                       throw new Exception( "Got invalid callback." );
-               }
-
+       public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) {
                $ok = $this->mergeViaCas( $key, $callback, $exptime, $attempts );
                if ( ( $flags & self::WRITE_SYNC ) == self::WRITE_SYNC ) {
                        $ok = $ok && $this->waitForSlaves();