X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FUserRightsProxy.php;h=e686ae3fc55b9bcfb8e99424e36e8c3e7016471a;hb=6ae9367cddf8565c948f4d9458b07bb688f2ddc2;hp=a19f6984f257f32c2030584ab5ad7ca9b621305d;hpb=bc9100fb3ca1128da415201528d0f19d20645916;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/UserRightsProxy.php b/includes/UserRightsProxy.php index a19f6984f2..e686ae3fc5 100644 --- a/includes/UserRightsProxy.php +++ b/includes/UserRightsProxy.php @@ -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,8 +278,10 @@ class UserRightsProxy { array( 'user_id' => $this->id ), __METHOD__ ); - $cache = ObjectCache::getMainWANInstance(); - $key = wfForeignMemcKey( $this->database, false, 'user', 'id', $this->id ); - $cache->delete( $key ); + $wikiId = $this->db->getWikiID(); + $userId = $this->id; + $this->db->onTransactionPreCommitOrIdle( function() use ( $wikiId, $userId ) { + User::purge( $wikiId, $userId ); + } ); } }