X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Fobjectcache%2FCachedBagOStuff.php;h=8b4c9c686f54e2332c813ea703e7fc95a8ee70f7;hb=825d66bfa44c5dae2b78e2fe4f3b16f16aff4a12;hp=b1d2b6c74c68369701e286b3f01b4bf04b8a482f;hpb=b48b6cbe0e7860c52fd6913853a7d054c7721017;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/objectcache/CachedBagOStuff.php b/includes/libs/objectcache/CachedBagOStuff.php index b1d2b6c74c..8b4c9c686f 100644 --- a/includes/libs/objectcache/CachedBagOStuff.php +++ b/includes/libs/objectcache/CachedBagOStuff.php @@ -87,6 +87,7 @@ class CachedBagOStuff extends BagOStuff { public function set( $key, $value, $exptime = 0, $flags = 0 ) { $this->procCache->set( $key, $value, $exptime, $flags ); + if ( !$this->fieldHasFlags( $flags, self::WRITE_CACHE_ONLY ) ) { $this->backend->set( $key, $value, $exptime, $flags ); } @@ -96,6 +97,7 @@ class CachedBagOStuff extends BagOStuff { public function delete( $key, $flags = 0 ) { $this->procCache->delete( $key, $flags ); + if ( !$this->fieldHasFlags( $flags, self::WRITE_CACHE_ONLY ) ) { $this->backend->delete( $key, $flags ); } @@ -194,22 +196,22 @@ class CachedBagOStuff extends BagOStuff { return true; } - public function incr( $key, $value = 1 ) { + public function incr( $key, $value = 1, $flags = 0 ) { $this->procCache->delete( $key ); - return $this->backend->incr( $key, $value ); + return $this->backend->incr( $key, $value, $flags ); } - public function decr( $key, $value = 1 ) { + public function decr( $key, $value = 1, $flags = 0 ) { $this->procCache->delete( $key ); - return $this->backend->decr( $key, $value ); + return $this->backend->decr( $key, $value, $flags ); } - public function incrWithInit( $key, $ttl, $value = 1, $init = 1 ) { + public function incrWithInit( $key, $exptime, $value = 1, $init = null, $flags = 0 ) { $this->procCache->delete( $key ); - return $this->backend->incrWithInit( $key, $ttl, $value, $init ); + return $this->backend->incrWithInit( $key, $exptime, $value, $init, $flags ); } public function addBusyCallback( callable $workCallback ) {