Merge "Update OOjs to v1.1.4"
[lhc/web/wiklou.git] / includes / objectcache / MultiWriteBagOStuff.php
index c656bdd..04ed894 100644 (file)
@@ -29,7 +29,8 @@
  * @ingroup Cache
  */
 class MultiWriteBagOStuff extends BagOStuff {
-       var $caches;
+       /** @var array BagOStuff[] */
+       protected $caches;
 
        /**
         * Constructor. Parameters are:
@@ -80,6 +81,7 @@ class MultiWriteBagOStuff extends BagOStuff {
         * @param mixed $value
         * @param mixed $exptime
         * @return bool
+        * @throws MWException
         */
        public function cas( $casToken, $key, $value, $exptime = 0 ) {
                throw new MWException( "CAS is not implemented in " . __CLASS__ );
@@ -114,16 +116,6 @@ class MultiWriteBagOStuff extends BagOStuff {
                return $this->doWrite( 'add', $key, $value, $exptime );
        }
 
-       /**
-        * @param string $key
-        * @param mixed $value
-        * @param int $exptime
-        * @return bool
-        */
-       public function replace( $key, $value, $exptime = 0 ) {
-               return $this->doWrite( 'replace', $key, $value, $exptime );
-       }
-
        /**
         * @param string $key
         * @param int $value
@@ -145,12 +137,13 @@ class MultiWriteBagOStuff extends BagOStuff {
        /**
         * @param string $key
         * @param int $timeout
+        * @param int $expiry
         * @return bool
         */
-       public function lock( $key, $timeout = 0 ) {
+       public function lock( $key, $timeout = 6, $expiry = 6 ) {
                // Lock only the first cache, to avoid deadlocks
                if ( isset( $this->caches[0] ) ) {
-                       return $this->caches[0]->lock( $key, $timeout );
+                       return $this->caches[0]->lock( $key, $timeout, $expiry );
                } else {
                        return true;
                }