From: Aaron Schulz Date: Thu, 8 Oct 2015 03:51:00 +0000 (-0700) Subject: Add get() flags support to BagOStuff::getWithSetCallback() X-Git-Tag: 1.31.0-rc.0~9472^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=b39fcc855c19b31f0bd673535a779940fa3cfccc;p=lhc%2Fweb%2Fwiklou.git Add get() flags support to BagOStuff::getWithSetCallback() Change-Id: Ib6046f5bc5d8c0481f90b56c381ba761fee558d6 --- diff --git a/includes/libs/objectcache/BagOStuff.php b/includes/libs/objectcache/BagOStuff.php index ecdf48fc95..8cbd48a638 100644 --- a/includes/libs/objectcache/BagOStuff.php +++ b/includes/libs/objectcache/BagOStuff.php @@ -95,11 +95,12 @@ abstract class BagOStuff implements LoggerAwareInterface { * @param string $key * @param int $ttl Time-to-live (seconds) * @param callable $callback Callback that derives the new value + * @param integer $flags Bitfield of BagOStuff::READ_* constants [optional] * @return mixed The cached value if found or the result of $callback otherwise * @since 1.27 */ - final public function getWithSetCallback( $key, $ttl, $callback ) { - $value = $this->get( $key ); + final public function getWithSetCallback( $key, $ttl, $callback, $flags = 0 ) { + $value = $this->get( $key, $flags ); if ( $value === false ) { if ( !is_callable( $callback ) ) {