MediaWiki  1.28.1
WikiMap Class Reference

Helper tools for dealing with other wikis. More...

Static Public Member Functions

static foreignUserLink ($wikiID, $user, $text=null)
 Convenience to get a link to a user page on a foreign wiki. More...
 
static getForeignURL ($wikiID, $page, $fragmentId=null)
 Convenience to get a url to a page on a foreign wiki. More...
 
static getWiki ($wikiID)
 Get a WikiReference object for $wikiID. More...
 
static getWikiName ($wikiID)
 Convenience to get the wiki's display name. More...
 
static makeForeignLink ($wikiID, $page, $text=null)
 Convenience to get a link to a page on a foreign wiki. More...
 

Static Private Member Functions

static getWikiReferenceFromWgConf ($wikiID)
 
static getWikiWikiReferenceFromSites ($wikiID)
 

Detailed Description

Helper tools for dealing with other wikis.

Definition at line 26 of file WikiMap.php.

Member Function Documentation

static WikiMap::foreignUserLink (   $wikiID,
  $user,
  $text = null 
)
static

Convenience to get a link to a user page on a foreign wiki.

Parameters
string$wikiIDWiki'd id (generally database name)
string$userUser name (must be normalised before calling this function!)
string$textLink's text; optional, default to "User:$user"
Returns
string HTML link or false if the wiki was not found

Definition at line 134 of file WikiMap.php.

Referenced by RightsLogFormatter\makePageLink(), and WikiMapTest\testForeignUserLink().

static WikiMap::getForeignURL (   $wikiID,
  $page,
  $fragmentId = null 
)
static

Convenience to get a url to a page on a foreign wiki.

Parameters
string$wikiIDWiki'd id (generally database name)
string$pagePage name (must be normalised before calling this function!)
string | null$fragmentId
Returns
string|bool URL or false if the wiki was not found

Definition at line 168 of file WikiMap.php.

References $page, and getWiki().

Referenced by Linker\makeCommentLink(), and WikiMapTest\testGetForeignURL().

static WikiMap::getWiki (   $wikiID)
static

Get a WikiReference object for $wikiID.

Parameters
string$wikiIDWiki'd id (generally database name)
Returns
WikiReference|null WikiReference object or null if the wiki was not found

Definition at line 34 of file WikiMap.php.

Referenced by getForeignURL(), getWikiName(), and WikiMapTest\testGetWiki().

static WikiMap::getWikiName (   $wikiID)
static

Convenience to get the wiki's display name.

Todo:
We can give more info than just the wiki id!
Parameters
string$wikiIDWiki'd id (generally database name)
Returns
string|int Wiki's name or $wiki_id if the wiki was not found

Definition at line 117 of file WikiMap.php.

References getWiki().

Referenced by WikiMapTest\testGetWikiName().

static WikiMap::getWikiReferenceFromWgConf (   $wikiID)
staticprivate
Parameters
string$wikiID
Returns
WikiReference|null WikiReference object or null if the wiki was not found

Definition at line 48 of file WikiMap.php.

References $path, $wgConf, global, and list.

static WikiMap::getWikiWikiReferenceFromSites (   $wikiID)
staticprivate
Parameters
string$wikiID
Returns
WikiReference|null WikiReference object or null if the wiki was not found

Definition at line 83 of file WikiMap.php.

References $path, and wfParseUrl().

static WikiMap::makeForeignLink (   $wikiID,
  $page,
  $text = null 
)
static

Convenience to get a link to a page on a foreign wiki.

Parameters
string$wikiIDWiki'd id (generally database name)
string$pagePage name (must be normalised before calling this function!)
string$textLink's text; optional, default to $page
Returns
string HTML link or false if the wiki was not found

Definition at line 146 of file WikiMap.php.

References $page, and Linker\makeExternalLink().

Referenced by WikiMapTest\testMakeForeignLink().


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