Merge "Removed unused and poorly supported time argument to BagOStuff::delete"
[lhc/web/wiklou.git] / includes / objectcache / HashBagOStuff.php
index 6e50a8c..a466282 100644 (file)
@@ -31,7 +31,8 @@ class HashBagOStuff extends BagOStuff {
        /** @var array */
        protected $bag;
 
-       function __construct() {
+       function __construct( $params = array() ) {
+               parent::__construct( $params );
                $this->bag = array();
        }
 
@@ -65,7 +66,7 @@ class HashBagOStuff extends BagOStuff {
                        return false;
                }
 
-               $casToken = serialize( $this->bag[$key][0] );
+               $casToken = $this->bag[$key][0];
 
                return $this->bag[$key][0];
        }
@@ -89,7 +90,7 @@ class HashBagOStuff extends BagOStuff {
         * @return bool
         */
        function cas( $casToken, $key, $value, $exptime = 0 ) {
-               if ( serialize( $this->get( $key ) ) === $casToken ) {
+               if ( $this->get( $key ) === $casToken ) {
                        return $this->set( $key, $value, $exptime );
                }
 
@@ -98,10 +99,9 @@ class HashBagOStuff extends BagOStuff {
 
        /**
         * @param string $key
-        * @param int $time
         * @return bool
         */
-       function delete( $key, $time = 0 ) {
+       function delete( $key ) {
                if ( !isset( $this->bag[$key] ) ) {
                        return false;
                }