Add get() flags support to BagOStuff::getWithSetCallback()
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 8 Oct 2015 03:51:00 +0000 (20:51 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 8 Oct 2015 03:51:00 +0000 (20:51 -0700)
Change-Id: Ib6046f5bc5d8c0481f90b56c381ba761fee558d6

includes/libs/objectcache/BagOStuff.php

index ecdf48f..8cbd48a 100644 (file)
@@ -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 ) ) {