Fix #5728: mVersion missing from User::__sleep() leading to constant cache miss
authorAntoine Musso <hashar@users.mediawiki.org>
Wed, 26 Apr 2006 17:17:57 +0000 (17:17 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Wed, 26 Apr 2006 17:17:57 +0000 (17:17 +0000)
RELEASE-NOTES
includes/User.php

index e796bda..fb9c3fb 100644 (file)
@@ -125,6 +125,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   ("editinginterface")
 * (bug 4834) Fix XHTML output when using $wgMaxTocLevel
 * Pass login link to "whitelistedittext" containing 'returnto' parameter
+* (bug 5728): mVersion missing from User::__sleep() leading to constant cache miss
 
 == Compatibility ==
 
index 5257067..bd8b06c 100644 (file)
@@ -21,6 +21,9 @@ define( 'MW_USER_VERSION', 3 );
  * @package MediaWiki
  */
 class User {
+       /*
+        * When adding a new private variable, dont forget to add it to __sleep()
+        */
        /**@{{
         * @private
         */
@@ -110,13 +113,31 @@ class User {
 
        /**
         * Serialze sleep function, for better cache efficiency and avoidance of
-        * silly "incomplete type" errors when skins are cached
+        * silly "incomplete type" errors when skins are cached. The array should
+        * contain names of private variables (see at top of User.php).
         */
        function __sleep() {
-               return array( 'mId', 'mName', 'mPassword', 'mEmail', 'mNewtalk',
-                       'mEmailAuthenticated', 'mRights', 'mOptions', 'mDataLoaded',
-                       'mNewpassword', 'mBlockedby', 'mBlockreason', 'mTouched',
-                       'mToken', 'mRealName', 'mHash', 'mGroups', 'mRegistration' );
+               return array(
+'mBlockedby',
+'mBlockreason',
+'mDataLoaded',
+'mEmail',
+'mEmailAuthenticated',
+'mGroups',
+'mHash',
+'mId',
+'mName',
+'mNewpassword',
+'mNewtalk',
+'mOptions',
+'mPassword',
+'mRealName',
+'mRegistration',
+'mRights',
+'mToken',
+'mTouched',
+'mVersion',
+);
        }
 
        /**