* @return bool Whether it exists
*/
public static function isValidInterwiki( $prefix ) {
+ wfDeprecated( __METHOD__, '1.28' );
return MediaWikiServices::getInstance()->getInterwikiLookup()->isValidInterwiki( $prefix );
}
* @return Interwiki|null|bool
*/
public static function fetch( $prefix ) {
+ wfDeprecated( __METHOD__, '1.28' );
return MediaWikiServices::getInstance()->getInterwikiLookup()->fetch( $prefix );
}
* @since 1.26
*/
public static function invalidateCache( $prefix ) {
+ wfDeprecated( __METHOD__, '1.28' );
MediaWikiServices::getInstance()->getInterwikiLookup()->invalidateCache( $prefix );
}
* @since 1.19
*/
public static function getAllPrefixes( $local = null ) {
+ wfDeprecated( __METHOD__, '1.28' );
return MediaWikiServices::getInstance()->getInterwikiLookup()->getAllPrefixes( $local );
}
* @author Katie Filbert < aude.wiki@gmail.com >
*/
+use MediaWiki\MediaWikiServices;
+
require_once __DIR__ . '/Maintenance.php';
class PopulateInterwiki extends Maintenance {
}
}
+ $lookup = MediaWikiServices::getInstance()->getInterwikiLookup();
foreach ( $data as $d ) {
$prefix = $d['prefix'];
);
}
- Interwiki::invalidateCache( $prefix );
+ $lookup->invalidateCache( $prefix );
}
$this->output( "Interwiki links are populated.\n" );
$this->assertSame( true, $interwiki->isLocal(), 'isLocal' );
$this->assertSame( false, $interwiki->isTranscludable(), 'isTranscludable' );
- Interwiki::invalidateCache( 'de' );
+ $interwikiLookup->invalidateCache( 'de' );
$this->assertNotSame( $interwiki, $interwikiLookup->fetch( 'de' ), 'invalidate cache' );
}