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 )
+ );
}
/**
$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 );
}
// 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 );
// 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 )