From: Tim Starling Date: Fri, 19 Oct 2012 03:02:39 +0000 (+1100) Subject: Clear $this->mOptionsLoaded in User::clearInstanceCache() X-Git-Tag: 1.31.0-rc.0~21954 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=b7b606b3a2a34b6c291c270932501b500cefc31e;p=lhc%2Fweb%2Fwiklou.git Clear $this->mOptionsLoaded in User::clearInstanceCache() (bug 41198) If clearInstanceCache() is to clear cached user data apart from the data from the user table, as addToDatabase() expects, then $this->mOptionsLoaded needs to be set to false. Clearing $this->mOptions may reduce memory usage a bit, but is not sufficient. Change-Id: I6912415dc154d06f62839a1ee777c2c3747253d6 --- diff --git a/includes/User.php b/includes/User.php index 809c18385c..0a02dd2b88 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1168,7 +1168,9 @@ class User { } /** - * Clear various cached data stored in this object. + * Clear various cached data stored in this object. The cache of the user table + * data (i.e. self::$mCacheVars) is not cleared unless $reloadFrom is given. + * * @param $reloadFrom bool|String Reload user and user_groups table data from a * given source. May be "name", "id", "defaults", "session", or false for * no reload. @@ -1182,6 +1184,7 @@ class User { $this->mEffectiveGroups = null; $this->mImplicitGroups = null; $this->mOptions = null; + $this->mOptionsLoaded = false; $this->mEditCount = null; if ( $reloadFrom ) {