* @deprecated Since 1.28 Use MediaWikiServices::getInstance()->getMainWANObjectCache()
*/
public static function getMainWANInstance() {
+ wfDeprecated( __METHOD__, '1.28' );
return MediaWikiServices::getInstance()->getMainWANObjectCache();
}
// Wipe WANObjectCache process cache, which is invalidated by article insertion
// due to T144706
- ObjectCache::getMainWANInstance()->clearProcessCache();
+ MediaWikiServices::getInstance()->getMainWANObjectCache()->clearProcessCache();
$this->executeSetupSnippets( $teardown );
}
new TitleValue( 1, 'ApiQueryWatchlistRawIntegrationTestPage1' ),
] );
- ObjectCache::getMainWANInstance()->clearProcessCache();
+ MediaWikiServices::getInstance()->getMainWANObjectCache()->clearProcessCache();
$result = $this->doListWatchlistRawRequest( [
'wrowner' => $otherUser->getName(),
'wrtoken' => '1234567890',
}
public function testGetLinkClasses() {
- $wanCache = ObjectCache::getMainWANInstance();
- $titleFormatter = MediaWikiServices::getInstance()->getTitleFormatter();
- $nsInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
+ $services = MediaWikiServices::getInstance();
+ $wanCache = $services->getMainWANObjectCache();
+ $titleFormatter = $services->getTitleFormatter();
+ $nsInfo = $services->getNamespaceInfo();
$linkCache = new LinkCache( $titleFormatter, $wanCache, $nsInfo );
$foobarTitle = new TitleValue( NS_MAIN, 'FooBar' );
$redirectTitle = new TitleValue( NS_MAIN, 'Redirect' );
$this->db->delete( 'actor', [ 'actor_user' => $id ], __METHOD__ );
User::purge( $domain, $id );
// Because WANObjectCache->delete() stupidly doesn't delete from the process cache.
- ObjectCache::getMainWANInstance()->clearProcessCache();
+
+ MediaWikiServices::getInstance()->getMainWANObjectCache()->clearProcessCache();
$user = User::newFromId( $id );
$this->assertFalse( $user->getActorId() > 0, 'No Actor ID by default if none in database' );