dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bd91985
)
Serliazed version check on user records in memcached
author
Brion Vibber
<brion@users.mediawiki.org>
Sun, 26 Jun 2005 07:00:09 +0000
(07:00 +0000)
committer
Brion Vibber
<brion@users.mediawiki.org>
Sun, 26 Jun 2005 07:00:09 +0000
(07:00 +0000)
includes/User.php
patch
|
blob
|
history
diff --git
a/includes/User.php
b/includes/User.php
index
f80e644
..
5f18a22
100644
(file)
--- a/
includes/User.php
+++ b/
includes/User.php
@@
-13,6
+13,9
@@
require_once( 'WatchedItem.php' );
# Number of characters in user_token field
define( 'USER_TOKEN_LENGTH', 32 );
# Number of characters in user_token field
define( 'USER_TOKEN_LENGTH', 32 );
+# Serialized record version
+define( 'MW_USER_VERSION', 2 );
+
/**
*
* @package MediaWiki
/**
*
* @package MediaWiki
@@
-32,10
+35,12
@@
class User {
var $mRealName;
var $mHash;
var $mGroups;
var $mRealName;
var $mHash;
var $mGroups;
+ var $mVersion; // serialized version
/** Construct using User:loadDefaults() */
function User() {
$this->loadDefaults();
/** Construct using User:loadDefaults() */
function User() {
$this->loadDefaults();
+ $this->mVersion = MW_USER_VERSION;
}
/**
}
/**
@@
-526,6
+531,7
@@
class User {
$passwordCorrect = FALSE;
$user = $wgMemc->get( $key = "$wgDBname:user:id:$sId" );
$passwordCorrect = FALSE;
$user = $wgMemc->get( $key = "$wgDBname:user:id:$sId" );
+ if( $user->mVersion < MW_USER_VERSION ) $user = false;
if($makenew = !$user) {
wfDebug( "User::loadFromSession() unable to load from memcached\n" );
$user = new User();
if($makenew = !$user) {
wfDebug( "User::loadFromSession() unable to load from memcached\n" );
$user = new User();