Merge "Separate startUp() call from main script of mediawiki module"
[lhc/web/wiklou.git] / includes / objectcache / MultiWriteBagOStuff.php
index 6a69137..b5333fd 100644 (file)
@@ -43,6 +43,7 @@ class MultiWriteBagOStuff extends BagOStuff {
         * @throws MWException
         */
        public function __construct( $params ) {
+               parent::__construct( $params );
                if ( !isset( $params['caches'] ) ) {
                        throw new MWException( __METHOD__ . ': the caches parameter is required' );
                }
@@ -81,6 +82,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__ );
@@ -98,11 +100,10 @@ class MultiWriteBagOStuff extends BagOStuff {
 
        /**
         * @param string $key
-        * @param int $time
         * @return bool
         */
-       public function delete( $key, $time = 0 ) {
-               return $this->doWrite( 'delete', $key, $time );
+       public function delete( $key ) {
+               return $this->doWrite( 'delete', $key );
        }
 
        /**
@@ -136,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;
                }