X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fobjectcache%2FSqlBagOStuff.php;h=df878f720574bbb7af68391323c8cc1170742cdb;hb=250f2b9e5ad67e22274961dd3464589d1559eb08;hp=03b0166b6a8a99cbea0db5b560d412148fbd4354;hpb=2b2aa59638eafaa914da50dba5cc489cc5d96b44;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index 03b0166b6a..df878f7205 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -405,7 +405,7 @@ class SqlBagOStuff extends BagOStuff { * @param int $exptime * @return bool */ - public function cas( $casToken, $key, $value, $exptime = 0 ) { + protected function cas( $casToken, $key, $value, $exptime = 0 ) { list( $serverIndex, $tableName ) = $this->getTableByKey( $key ); try { $db = $this->getDB( $serverIndex ); @@ -514,6 +514,14 @@ class SqlBagOStuff extends BagOStuff { return $newValue; } + 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 ); + } + /** * @param DatabaseBase $db * @param string $exptime