MediaWiki  1.28.0
Interwiki Class Reference

Value object for representing interwiki records. More...

Collaboration diagram for Interwiki:

Public Member Functions

 __construct ($prefix=null, $url= '', $api= '', $wikiId= '', $local=0, $trans=0)
 
 getAPI ()
 Get the API URL for this wiki. More...
 
 getDescription ()
 Get a description for this interwiki. More...
 
 getName ()
 Get the name for the interwiki site. More...
 
 getURL ($title=null)
 Get the URL for a particular title (or with $1 if no title given) More...
 
 getWikiID ()
 Get the DB name for this wiki. More...
 
 isLocal ()
 Is this a local link from a sister project, or is it something outside, like Google. More...
 
 isTranscludable ()
 Can pages from this wiki be transcluded? Still requires $wgEnableScaryTransclusion. More...
 

Static Public Member Functions

static fetch ($prefix)
 Fetch an Interwiki object. More...
 
static getAllPrefixes ($local=null)
 Returns all interwiki prefixes. More...
 
static invalidateCache ($prefix)
 Purge the cache (local and persistent) for an interwiki prefix. More...
 
static isValidInterwiki ($prefix)
 Check whether an interwiki prefix exists. More...
 

Protected Attributes

string $mAPI
 The URL of the file api.php. More...
 
bool $mLocal
 Whether the wiki is in this project. More...
 
string $mPrefix
 The interwiki prefix, (e.g. More...
 
bool $mTrans
 Whether interwiki transclusions are allowed. More...
 
string $mURL
 The URL of the wiki, with "$1" as a placeholder for an article name. More...
 
string $mWikiID
 The name of the database (for a connection to be established with wfGetLB( 'wikiid' )) More...
 

Detailed Description

Value object for representing interwiki records.

Definition at line 27 of file Interwiki.php.

Constructor & Destructor Documentation

Interwiki::__construct (   $prefix = null,
  $url = '',
  $api = '',
  $wikiId = '',
  $local = 0,
  $trans = 0 
)

Definition at line 49 of file Interwiki.php.

Member Function Documentation

static Interwiki::fetch (   $prefix)
static

Fetch an Interwiki object.

Deprecated:
since 1.28, use InterwikiLookup instead
Parameters
string$prefixInterwiki prefix to use
Returns
Interwiki|null|bool

Definition at line 80 of file Interwiki.php.

Referenced by ImportStreamSource\newFromInterwiki(), InterwikiTest\testArrayStorage(), InterwikiTest\testCDBStorage(), and InterwikiTest\testDatabaseStorage().

static Interwiki::getAllPrefixes (   $local = null)
static

Returns all interwiki prefixes.

Deprecated:
since 1.28, unused. Use InterwikiLookup instead.
Parameters
string | null$localIf set, limits output to local/non-local interwikis
Returns
array List of prefixes
Since
1.19

Definition at line 103 of file Interwiki.php.

Referenced by ApiQuerySiteinfo\appendInterwikiMap(), NamespaceConflictChecker\getInterwikiList(), InterwikiTest\testArrayStorage(), InterwikiTest\testCDBStorage(), and InterwikiTest\testDatabaseStorage().

Interwiki::getAPI ( )

Get the API URL for this wiki.

Returns
string The URL

Definition at line 130 of file Interwiki.php.

References $mAPI.

Interwiki::getDescription ( )

Get a description for this interwiki.

Returns
string

Definition at line 179 of file Interwiki.php.

References wfMessage().

Interwiki::getName ( )

Get the name for the interwiki site.

Returns
string

Definition at line 168 of file Interwiki.php.

References wfMessage().

Interwiki::getURL (   $title = null)

Get the URL for a particular title (or with $1 if no title given)

Parameters
string$titleWhat text to put for the article name
Returns
string The URL
Note
Prior to 1.19 The getURL with an argument was broken. If you if you use this arg in an extension that supports MW earlier than 1.19 please wfUrlencode and substitute $1 on your own.

Definition at line 116 of file Interwiki.php.

References $mURL, $title, and wfUrlencode().

Interwiki::getWikiID ( )

Get the DB name for this wiki.

Returns
string The DB name

Definition at line 139 of file Interwiki.php.

References $mWikiID.

static Interwiki::invalidateCache (   $prefix)
static

Purge the cache (local and persistent) for an interwiki prefix.

Parameters
string$prefix
Since
1.26

Definition at line 90 of file Interwiki.php.

Referenced by InterwikiTest\testDatabaseStorage().

Interwiki::isLocal ( )

Is this a local link from a sister project, or is it something outside, like Google.

Returns
bool

Definition at line 149 of file Interwiki.php.

References $mLocal.

Interwiki::isTranscludable ( )

Can pages from this wiki be transcluded? Still requires $wgEnableScaryTransclusion.

Returns
bool

Definition at line 159 of file Interwiki.php.

References $mTrans.

static Interwiki::isValidInterwiki (   $prefix)
static

Check whether an interwiki prefix exists.

Deprecated:
since 1.28, use InterwikiLookup instead
Parameters
string$prefixInterwiki prefix to use
Returns
bool Whether it exists

Definition at line 68 of file Interwiki.php.

Referenced by MediaWikiTitleCodec\splitTitleString(), InterwikiTest\testArrayStorage(), InterwikiTest\testCDBStorage(), and InterwikiTest\testDatabaseStorage().

Member Data Documentation

string Interwiki::$mAPI
protected

The URL of the file api.php.

Definition at line 36 of file Interwiki.php.

Referenced by getAPI().

bool Interwiki::$mLocal
protected

Whether the wiki is in this project.

Definition at line 44 of file Interwiki.php.

Referenced by isLocal().

string Interwiki::$mPrefix
protected

The interwiki prefix, (e.g.

"Meatball", or the language prefix "de")

Definition at line 30 of file Interwiki.php.

bool Interwiki::$mTrans
protected

Whether interwiki transclusions are allowed.

Definition at line 47 of file Interwiki.php.

Referenced by isTranscludable().

string Interwiki::$mURL
protected

The URL of the wiki, with "$1" as a placeholder for an article name.

Definition at line 33 of file Interwiki.php.

Referenced by getURL().

string Interwiki::$mWikiID
protected

The name of the database (for a connection to be established with wfGetLB( 'wikiid' ))

Definition at line 41 of file Interwiki.php.

Referenced by getWikiID().


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