X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FUserRightsProxy.php;h=3a3eb538732f779ac8cdff87c0aef1f55bac6327;hb=7c07943eab6e3654ae3ccd3081f4cc74d48e5876;hp=1b9e4b69065d2c948e2ab374578c7cdfe4017073;hpb=ca3ac3dfb89d2e801a65565dd8186ff250cde3df;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/UserRightsProxy.php b/includes/UserRightsProxy.php index 1b9e4b6906..3a3eb53873 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,9 @@ class UserRightsProxy { array( 'user_id' => $this->id ), __METHOD__ ); - global $wgMemc; $key = wfForeignMemcKey( $this->database, false, 'user', 'id', $this->id ); - $wgMemc->delete( $key ); + $this->db->onTransactionPreCommitOrIdle( function() use ( $key ) { + ObjectCache::getMainWANInstance()->delete( $key ); + } ); } }