MediaWiki master
MediaWiki\Interwiki\InterwikiLookup Interface Reference

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

Inherited by MediaWiki\Interwiki\ClassicInterwikiLookup, MediaWiki\Interwiki\InterwikiLookupAdapter, and MediaWiki\Interwiki\NullInterwikiLookup.

Public Member Functions

 fetch ( $prefix)
 Get the Interwiki object for a given prefix.
 
 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 any persistent cache (e.g.
 
 isValidInterwiki ( $prefix)
 Check whether an interwiki prefix exists.
 

Detailed Description

Service interface for looking up Interwiki records.

Default implementation is ClassicInterwikiLookup.

Since
1.28

Definition at line 32 of file InterwikiLookup.php.

Member Function Documentation

◆ fetch()

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

Get the Interwiki object for a given prefix.

Parameters
string$prefixInterwiki prefix
Returns
Interwiki|null|false Null for invalid, false for not found

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
bool | null$localIf set, limit output to local or 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 any persistent cache (e.g.

memcached) 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
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: