X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Fobjectcache%2FCachedBagOStuff.php;h=95dda71f2a7751acd9523b4bc28fe78b9cf29cda;hb=3f592fc4cb6f386e3f8d2e0b72bddae8b263aca8;hp=3927ed3004d2cea258f8207e4a68d2c125b608c7;hpb=db1f41172f6f7670b87c96bfb11a2cab07ac19ac;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/objectcache/CachedBagOStuff.php b/includes/libs/objectcache/CachedBagOStuff.php index 3927ed3004..95dda71f2a 100644 --- a/includes/libs/objectcache/CachedBagOStuff.php +++ b/includes/libs/objectcache/CachedBagOStuff.php @@ -101,6 +101,21 @@ class CachedBagOStuff extends HashBagOStuff { // These just call the backend (tested elsewhere) // @codeCoverageIgnoreStart + public function add( $key, $value, $exptime = 0, $flags = 0 ) { + if ( $this->get( $key ) === false ) { + return $this->set( $key, $value, $exptime, $flags ); + } + + return false; // key already set + } + + public function incr( $key, $value = 1 ) { + $n = $this->backend->incr( $key, $value ); + parent::delete( $key ); + + return $n; + } + public function lock( $key, $timeout = 6, $expiry = 6, $rclass = '' ) { return $this->backend->lock( $key, $timeout, $expiry, $rclass ); } @@ -117,9 +132,5 @@ class CachedBagOStuff extends HashBagOStuff { return $this->backend->clearLastError(); } - public function modifySimpleRelayEvent( array $event ) { - return $this->backend->modifySimpleRelayEvent( $event ); - } - // @codeCoverageIgnoreEnd }