Merge "maintenance: Script to rename titles for Unicode uppercasing changes"
[lhc/web/wiklou.git] / includes / libs / objectcache / MultiWriteBagOStuff.php
index adb9bb8..4c6750f 100644 (file)
@@ -130,12 +130,14 @@ class MultiWriteBagOStuff extends BagOStuff {
                                $missIndexes,
                                $this->asyncWrites,
                                'set',
+                               // @TODO: consider using self::WRITE_ALLOW_SEGMENTS here?
                                [ $key, $value, self::UPGRADE_TTL ]
                        );
                }
 
                return $value;
        }
+
        public function set( $key, $value, $exptime = 0, $flags = 0 ) {
                return $this->doWrite(
                        $this->cacheIndexes,
@@ -205,18 +207,15 @@ class MultiWriteBagOStuff extends BagOStuff {
                // Only the first cache is locked
                return $this->caches[0]->unlock( $key );
        }
-       /**
-        * Delete objects expiring before a certain date.
-        *
-        * Succeed if any of the child caches succeed.
-        * @param string $date
-        * @param bool|callable $progressCallback
-        * @return bool
-        */
-       public function deleteObjectsExpiringBefore( $date, $progressCallback = false ) {
+
+       public function deleteObjectsExpiringBefore(
+               $timestamp,
+               callable $progressCallback = null,
+               $limit = INF
+       ) {
                $ret = false;
                foreach ( $this->caches as $cache ) {
-                       if ( $cache->deleteObjectsExpiringBefore( $date, $progressCallback ) ) {
+                       if ( $cache->deleteObjectsExpiringBefore( $timestamp, $progressCallback, $limit ) ) {
                                $ret = true;
                        }
                }
@@ -289,13 +288,14 @@ class MultiWriteBagOStuff extends BagOStuff {
        public function clearLastError() {
                $this->caches[0]->clearLastError();
        }
+
        /**
         * Apply a write method to the backing caches specified by $indexes (in order)
         *
         * @param int[] $indexes List of backing cache indexes
         * @param bool $asyncWrites
         * @param string $method Method name of backing caches
-        * @param array[] $args Arguments to the method of backing caches
+        * @param array $args Arguments to the method of backing caches
         * @return bool
         */
        protected function doWrite( $indexes, $asyncWrites, $method, array $args ) {
@@ -353,4 +353,24 @@ class MultiWriteBagOStuff extends BagOStuff {
        protected function doGet( $key, $flags = 0, &$casToken = null ) {
                throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
        }
+
+       protected function doSet( $key, $value, $exptime = 0, $flags = 0 ) {
+               throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+       }
+
+       protected function doDelete( $key, $flags = 0 ) {
+               throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+       }
+
+       protected function doGetMulti( array $keys, $flags = 0 ) {
+               throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+       }
+
+       protected function serialize( $value ) {
+               throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+       }
+
+       protected function unserialize( $value ) {
+               throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+       }
 }