MediaWiki REL1_35
MediaWiki\Interwiki\InterwikiLookup Interface Reference

Service interface for looking up Interwiki records. More...

Inheritance diagram for MediaWiki\Interwiki\InterwikiLookup:

Public Member Functions

 fetch ( $prefix)
 Fetch an Interwiki object.
 
 getAllPrefixes ( $local=null)
 Returns information about all interwiki prefixes, in the form of rows of the interwiki table.
 
 invalidateCache ( $prefix)
 Purge the in-process and persistent object cache for an interwiki prefix.
 
 isValidInterwiki ( $prefix)
 Check whether an interwiki prefix exists.
 

Detailed Description

Service interface for looking up Interwiki records.

Since
1.28

Definition at line 32 of file InterwikiLookup.php.

Member Function Documentation

◆ fetch()

MediaWiki\Interwiki\InterwikiLookup::fetch (   $prefix)

Fetch an Interwiki object.

Parameters
string$prefixInterwiki prefix to use
Returns
Interwiki|null|bool

Implemented in MediaWiki\Interwiki\ClassicInterwikiLookup, MediaWiki\Interwiki\InterwikiLookupAdapter, and MediaWiki\Interwiki\NullInterwikiLookup.

◆ getAllPrefixes()

MediaWiki\Interwiki\InterwikiLookup::getAllPrefixes (   $local = null)

Returns information about all interwiki prefixes, in the form of rows of the interwiki table.

Each row may have the following keys:

  • iw_prefix: the prefix. Always present.
  • iw_url: the URL to use for linking, with $1 as a placeholder for the target page. Always present.
  • iw_api: the URL of the API. Optional.
  • iw_wikiid: the wiki ID (usually the database name for local wikis). Optional.
  • iw_local: whether the wiki is local, and the "magic redirect" mechanism should apply. Defaults to false.
  • iw_trans: whether "scary transclusion" is allowed for this site. Defaults to false.
Parameters
string | null$localIf set, limits output to local/non-local interwikis
Returns
array[] interwiki rows.

Implemented in MediaWiki\Interwiki\ClassicInterwikiLookup, MediaWiki\Interwiki\InterwikiLookupAdapter, and MediaWiki\Interwiki\NullInterwikiLookup.

◆ invalidateCache()

MediaWiki\Interwiki\InterwikiLookup::invalidateCache (   $prefix)

Purge the in-process and persistent object cache for an interwiki prefix.

Parameters
string$prefix

Implemented in MediaWiki\Interwiki\ClassicInterwikiLookup, MediaWiki\Interwiki\InterwikiLookupAdapter, and MediaWiki\Interwiki\NullInterwikiLookup.

◆ isValidInterwiki()

MediaWiki\Interwiki\InterwikiLookup::isValidInterwiki (   $prefix)

Check whether an interwiki prefix exists.

Parameters
string$prefixInterwiki prefix to use
Returns
bool Whether it exists

Implemented in MediaWiki\Interwiki\ClassicInterwikiLookup, MediaWiki\Interwiki\InterwikiLookupAdapter, and MediaWiki\Interwiki\NullInterwikiLookup.


The documentation for this interface was generated from the following file: