Merge "Avoid/Replace usage of deprecated wfMemcKey() function"

This commit is contained in:
jenkins-bot 2019-05-03 19:27:23 +00:00 committed by Gerrit Code Review
commit 94b9ae422b
3 changed files with 8 additions and 4 deletions

View file

@ -288,7 +288,9 @@ class CacheHelper implements ICacheHelper {
throw new MWException( 'No cache key set, so cannot obtain or save the CacheHelper values.' );
}
return wfMemcKey( ...array_values( $this->cacheKey ) );
return ObjectCache::getLocalClusterInstance()->makeKey(
...array_values( $this->cacheKey )
);
}
/**

View file

@ -114,7 +114,9 @@ class PoolWorkArticleView extends PoolCounterWork {
$this->revision = $revision;
$this->audience = $audience;
$this->cacheKey = $this->parserCache->getKey( $page, $parserOptions );
$keyPrefix = $this->cacheKey ?: wfMemcKey( 'articleview', 'missingcachekey' );
$keyPrefix = $this->cacheKey ?: ObjectCache::getLocalClusterInstance()->makeKey(
'articleview', 'missingcachekey'
);
parent::__construct( 'ArticleView', $keyPrefix . ':revid:' . $revid );
}

View file

@ -2670,7 +2670,7 @@ class AuthManagerTest extends \MediaWikiTestCase {
// Test backoff
$cache = \ObjectCache::getLocalClusterInstance();
$backoffKey = wfMemcKey( 'AuthManager', 'autocreate-failed', md5( $username ) );
$backoffKey = $cache->makeKey( 'AuthManager', 'autocreate-failed', md5( $username ) );
$cache->set( $backoffKey, true );
$session->clear();
$user = \User::newFromName( $username );
@ -2709,7 +2709,7 @@ class AuthManagerTest extends \MediaWikiTestCase {
// Test addToDatabase throws an exception
$cache = \ObjectCache::getLocalClusterInstance();
$backoffKey = wfMemcKey( 'AuthManager', 'autocreate-failed', md5( $username ) );
$backoffKey = $cache->makeKey( 'AuthManager', 'autocreate-failed', md5( $username ) );
$this->assertFalse( $cache->get( $backoffKey ), 'sanity check' );
$session->clear();
$user = $this->getMockBuilder( \User::class )