Merge "NotifUser: Un-merge getMemcKey() and getGlobalMemcKey()"

This commit is contained in:
jenkins-bot 2018-06-02 17:11:33 +00:00 committed by Gerrit Code Review
commit 533a58dfcc

View file

@ -612,17 +612,24 @@ class MWEchoNotifUser {
}
/**
* Build a memcached key.
* Build a cache key for local use (local to this wiki)
*
* @param string $key Key, typically prefixed with echo-notification-
* @param bool $global If true, return a global memc key; if false, return one local to this wiki
* @return string|false Memcached key, or false if one could not be generated (can only happen for global keys)
* @return string Cache key
*/
protected function getMemcKey( $key, $global = false ) {
protected function getMemcKey( $key ) {
global $wgEchoCacheVersion;
if ( !$global ) {
return wfMemcKey( $key, $this->mUser->getId(), $wgEchoCacheVersion );
}
return wfMemcKey( $key, $this->mUser->getId(), $wgEchoCacheVersion );
}
/**
* Build a cache key for global use
*
* @param string $key Key, typically prefixed with echo-notification-
* @return string|false Memcached key, or false if one could not be generated
*/
protected function getGlobalMemcKey( $key ) {
global $wgEchoCacheVersion;
$lookup = CentralIdLookup::factory();
$globalId = $lookup->centralIdFromLocalUser( $this->mUser, CentralIdLookup::AUDIENCE_RAW );
if ( !$globalId ) {
@ -631,10 +638,6 @@ class MWEchoNotifUser {
return wfGlobalCacheKey( $key, $globalId, $wgEchoCacheVersion );
}
protected function getGlobalMemcKey( $key ) {
return $this->getMemcKey( $key, true );
}
/**
* Lazy-construct an EchoForeignNotifications instance. This instance is force-enabled, so it
* returns information about cross-wiki notifications even if the user has them disabled.