MediaWiki  master
MediaWiki\Interwiki\InterwikiLookupAdapter Class Reference
Inheritance diagram for MediaWiki\Interwiki\InterwikiLookupAdapter:
Collaboration diagram for MediaWiki\Interwiki\InterwikiLookupAdapter:

Public Member Functions

 __construct (SiteLookup $siteLookup, array $interwikiMap=null)
 
 fetch ($prefix)
 See InterwikiLookup::fetch It loads the whole interwiki map. More...
 
 getAllPrefixes ($local=null)
 See InterwikiLookup::getAllPrefixes. More...
 
 invalidateCache ($prefix)
 See InterwikiLookup::invalidateCache. More...
 
 isValidInterwiki ($prefix)
 See InterwikiLookup::isValidInterwiki It loads the whole interwiki map. More...
 

Private Member Functions

 getInterwikiMap ()
 Get interwikiMap attribute, load if needed. More...
 
 getSiteInterwikis (Site $site)
 Load interwikis for the given site. More...
 
 loadInterwikiMap ()
 Load interwiki map to use as cache. More...
 

Private Attributes

Interwiki[] null $interwikiMap
 associative array mapping interwiki prefixes to Interwiki objects More...
 
SiteLookup $siteLookup
 

Detailed Description

Definition at line 35 of file InterwikiLookupAdapter.php.

Constructor & Destructor Documentation

MediaWiki\Interwiki\InterwikiLookupAdapter::__construct ( SiteLookup  $siteLookup,
array  $interwikiMap = null 
)

Member Function Documentation

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

See InterwikiLookup::fetch It loads the whole interwiki map.

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

Implements MediaWiki\Interwiki\InterwikiLookup.

Definition at line 73 of file InterwikiLookupAdapter.php.

References MediaWiki\Interwiki\InterwikiLookupAdapter\isValidInterwiki().

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

See InterwikiLookup::getAllPrefixes.

Parameters
string | null$localIf set, limits output to local/non-local interwikis
Returns
array[] interwiki rows

Implements MediaWiki\Interwiki\InterwikiLookup.

Definition at line 91 of file InterwikiLookupAdapter.php.

References $res, as, and MediaWiki\Interwiki\InterwikiLookupAdapter\getInterwikiMap().

MediaWiki\Interwiki\InterwikiLookupAdapter::getInterwikiMap ( )
private
MediaWiki\Interwiki\InterwikiLookupAdapter::getSiteInterwikis ( Site  $site)
private
MediaWiki\Interwiki\InterwikiLookupAdapter::invalidateCache (   $prefix)
MediaWiki\Interwiki\InterwikiLookupAdapter::isValidInterwiki (   $prefix)

See InterwikiLookup::isValidInterwiki It loads the whole interwiki map.

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

Implements MediaWiki\Interwiki\InterwikiLookup.

Definition at line 62 of file InterwikiLookupAdapter.php.

References MediaWiki\Interwiki\InterwikiLookupAdapter\getInterwikiMap().

Referenced by MediaWiki\Interwiki\InterwikiLookupAdapter\fetch().

MediaWiki\Interwiki\InterwikiLookupAdapter::loadInterwikiMap ( )
private

Member Data Documentation

Interwiki [] null MediaWiki\Interwiki\InterwikiLookupAdapter::$interwikiMap
private
SiteLookup MediaWiki\Interwiki\InterwikiLookupAdapter::$siteLookup
private

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