Ehcache more like mehcache
[lhc/web/wiklou.git] / includes / objectcache / DBABagOStuff.php
index 51ce777..a81b5c5 100644 (file)
@@ -125,6 +125,7 @@ class DBABagOStuff extends BagOStuff {
                }
 
                $val = dba_fetch( $key, $handle );
+               $casToken = $val;
                list( $val, $expiry ) = $this->decode( $val );
 
                # Must close ASAP because locks are held
@@ -139,8 +140,6 @@ class DBABagOStuff extends BagOStuff {
                        $val = false;
                }
 
-               $casToken = $val;
-
                wfProfileOut( __METHOD__ );
 
                return $val;
@@ -193,7 +192,6 @@ class DBABagOStuff extends BagOStuff {
                // DBA is locked to any other write connection, so we can safely
                // compare the current & previous value before saving new value
                $val = dba_fetch( $key, $handle );
-               list( $val, $exptime ) = $this->decode( $val );
                if ( $casToken !== $val ) {
                        dba_close( $handle );
                        wfProfileOut( __METHOD__ );
@@ -251,7 +249,7 @@ class DBABagOStuff extends BagOStuff {
 
                # Insert failed, check to see if it failed due to an expired key
                if ( !$ret ) {
-                       list( $value, $expiry ) = $this->decode( dba_fetch( $key, $handle ) );
+                       list( , $expiry ) = $this->decode( dba_fetch( $key, $handle ) );
 
                        if ( $expiry && $expiry < time() ) {
                                # Yes expired, delete and try again