Http::getProxy() method to get proxy configuration
[lhc/web/wiklou.git] / includes / UserRightsProxy.php
index 2c7032f..e686ae3 100644 (file)
@@ -31,7 +31,7 @@ class UserRightsProxy {
         *
         * @see newFromId()
         * @see newFromName()
-        * @param DatabaseBase $db Db connection
+        * @param IDatabase $db Db connection
         * @param string $database Database name
         * @param string $name User name
         * @param int $id User ID
@@ -146,7 +146,7 @@ class UserRightsProxy {
         *
         * @param string $database
         * @param bool $ignoreInvalidDB If true, don't check if $database is in $wgLocalDatabases
-        * @return DatabaseBase|null If invalid selection
+        * @return IDatabase|null If invalid selection
         */
        public static function getDB( $database, $ignoreInvalidDB = false ) {
                global $wgDBname;
@@ -278,9 +278,10 @@ class UserRightsProxy {
                        array( 'user_id' => $this->id ),
                        __METHOD__ );
 
-               $key = wfForeignMemcKey( $this->database, false, 'user', 'id', $this->id );
-               $this->db->onTransactionPreCommitOrIdle( function() use ( $key ) {
-                       ObjectCache::getMainWANInstance()->delete( $key );
+               $wikiId = $this->db->getWikiID();
+               $userId = $this->id;
+               $this->db->onTransactionPreCommitOrIdle( function() use ( $wikiId, $userId ) {
+                       User::purge( $wikiId, $userId );
                } );
        }
 }