objectcache: Use variadic signature for makeKey()
[lhc/web/wiklou.git] / includes / libs / objectcache / ReplicatedBagOStuff.php
index 6fac0ad..504d515 100644 (file)
@@ -69,9 +69,10 @@ class ReplicatedBagOStuff extends BagOStuff {
                $this->attrMap = $this->mergeFlagMaps( [ $this->readStore, $this->writeStore ] );
        }
 
-       public function setDebug( $debug ) {
-               $this->writeStore->setDebug( $debug );
-               $this->readStore->setDebug( $debug );
+       public function setDebug( $enabled ) {
+               parent::setDebug( $enabled );
+               $this->writeStore->setDebug( $enabled );
+               $this->readStore->setDebug( $enabled );
        }
 
        public function get( $key, $flags = 0 ) {
@@ -108,8 +109,12 @@ class ReplicatedBagOStuff extends BagOStuff {
                return $this->writeStore->unlock( $key );
        }
 
-       public function deleteObjectsExpiringBefore( $date, $progressCallback = false, $limit = INF ) {
-               return $this->writeStore->deleteObjectsExpiringBefore( $date, $progressCallback );
+       public function deleteObjectsExpiringBefore(
+               $timestamp,
+               callable $progress = null,
+               $limit = INF
+       ) {
+               return $this->writeStore->deleteObjectsExpiringBefore( $timestamp, $progress, $limit );
        }
 
        public function getMulti( array $keys, $flags = 0 ) {
@@ -126,6 +131,10 @@ class ReplicatedBagOStuff extends BagOStuff {
                return $this->writeStore->deleteMulti( $keys, $flags );
        }
 
+       public function changeTTLMulti( array $keys, $exptime, $flags = 0 ) {
+               return $this->writeStore->changeTTLMulti( $keys, $exptime, $flags );
+       }
+
        public function incr( $key, $value = 1 ) {
                return $this->writeStore->incr( $key, $value );
        }
@@ -153,35 +162,21 @@ class ReplicatedBagOStuff extends BagOStuff {
                return $this->writeStore->makeKeyInternal( ...func_get_args() );
        }
 
-       public function makeKey( $class, $component = null ) {
+       public function makeKey( $class, ...$components ) {
                return $this->writeStore->makeKey( ...func_get_args() );
        }
 
-       public function makeGlobalKey( $class, $component = null ) {
+       public function makeGlobalKey( $class, ...$components ) {
                return $this->writeStore->makeGlobalKey( ...func_get_args() );
        }
 
-       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.' );
+       public function addBusyCallback( callable $workCallback ) {
+               $this->writeStore->addBusyCallback( $workCallback );
        }
 
-       protected function unserialize( $blob ) {
-               throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+       public function setMockTime( &$time ) {
+               parent::setMockTime( $time );
+               $this->writeStore->setMockTime( $time );
+               $this->readStore->setMockTime( $time );
        }
 }