MediaWiki  REL1_19
Interwiki Class Reference

The interwiki class All information is loaded on creation when called by Interwiki::fetch( $prefix ). More...

List of all members.

Public Member Functions

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

Static Public Member Functions

static fetch ($prefix)
 Fetch an Interwiki object.
static getAllPrefixes ($local=null)
 Returns all interwiki prefixes.
static isValidInterwiki ($prefix)
 Check whether an interwiki prefix exists.

Public Attributes

 $mAPI
 $mLocal
 $mTrans
 $mURL
 $mWikiID
const CACHE_LIMIT = 100

Static Protected Member Functions

static getAllPrefixesCached ($local)
 Fetch all interwiki prefixes from interwiki cache.
static getAllPrefixesDB ($local)
 Fetch all interwiki prefixes from DB.
static getInterwikiCached ($prefix)
 Fetch interwiki prefix data from local cache in constant database.
static getInterwikiCacheEntry ($prefix)
 Get entry from interwiki cache.
static load ($prefix)
 Load the interwiki, trying first memcached then the DB.
static loadFromArray ($mc)
 Fill in member variables from an array (e.g.

Protected Attributes

 $mPrefix

Static Protected Attributes

static $smCache = array()

Detailed Description

The interwiki class All information is loaded on creation when called by Interwiki::fetch( $prefix ).

All work is done on slave, because this should *never* change (except during schema updates etc, which aren't wiki-related)

Definition at line 13 of file Interwiki.php.


Constructor & Destructor Documentation

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

Definition at line 21 of file Interwiki.php.

References $url.


Member Function Documentation

static Interwiki::fetch ( prefix) [static]

Fetch an Interwiki object.

Parameters:
$prefixString: interwiki prefix to use
Returns:
Interwiki Object, or null if not valid

Definition at line 47 of file Interwiki.php.

References $wgContLang, $wgInterwikiCache, getInterwikiCached(), and load().

Referenced by Title\getLocalURL(), Title\getTransWikiID(), Title\isLocal(), Title\isTrans(), and isValidInterwiki().

Here is the call graph for this function:

Here is the caller graph for this function:

static Interwiki::getAllPrefixes ( local = null) [static]

Returns all interwiki prefixes.

Parameters:
$localstring|null If set, limits output to local/non-local interwikis
Returns:
Array List of prefixes
Since:
1.19

Definition at line 308 of file Interwiki.php.

References $wgInterwikiCache, getAllPrefixesCached(), and getAllPrefixesDB().

Referenced by ApiQuerySiteinfo\appendInterwikiMap().

Here is the call graph for this function:

Here is the caller graph for this function:

static Interwiki::getAllPrefixesCached ( local) [static, protected]

Fetch all interwiki prefixes from interwiki cache.

Parameters:
$localnull|string If not null, limits output to local/non-local interwikis
Returns:
Array List of prefixes
Since:
1.19

Definition at line 213 of file Interwiki.php.

References $wgInterwikiCache, $wgInterwikiFallbackSite, $wgInterwikiScopes, CdbReader\open(), wfDebug(), and wfWikiID().

Referenced by getAllPrefixes().

Here is the call graph for this function:

Here is the caller graph for this function:

static Interwiki::getAllPrefixesDB ( local) [static, protected]

Fetch all interwiki prefixes from DB.

Parameters:
$localstring|null If not null, limits output to local/non-local interwikis
Returns:
Array List of prefixes
Since:
1.19

Definition at line 277 of file Interwiki.php.

References $res, and wfGetDB().

Referenced by getAllPrefixes().

Here is the call graph for this function:

Here is the caller graph for this function:

Get the API URL for this wiki.

Returns:
String: the URL

Definition at line 340 of file Interwiki.php.

Get a description for this interwiki.

Returns:
String

Definition at line 388 of file Interwiki.php.

References wfMessage().

Here is the call graph for this function:

static Interwiki::getInterwikiCached ( prefix) [static, protected]

Fetch interwiki prefix data from local cache in constant database.

Note:
More logic is explained in DefaultSettings.
Parameters:
$prefixString: interwiki prefix
Returns:
Interwiki object

Definition at line 81 of file Interwiki.php.

References $url, and getInterwikiCacheEntry().

Referenced by fetch().

Here is the call graph for this function:

Here is the caller graph for this function:

static Interwiki::getInterwikiCacheEntry ( prefix) [static, protected]

Get entry from interwiki cache.

Note:
More logic is explained in DefaultSettings.
Parameters:
$prefixString: database key
Returns:
String: the entry

Definition at line 104 of file Interwiki.php.

References $wgInterwikiCache, $wgInterwikiFallbackSite, $wgInterwikiScopes, CdbReader\open(), wfDebug(), wfMemcKey(), and wfWikiID().

Referenced by getInterwikiCached().

Here is the call graph for this function:

Here is the caller graph for this function:

Get the name for the interwiki site.

Returns:
String

Definition at line 378 of file Interwiki.php.

References wfMessage().

Here is the call graph for this function:

Interwiki::getURL ( title = null)

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

Parameters:
$titleString: what 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 327 of file Interwiki.php.

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

Here is the call graph for this function:

Get the DB name for this wiki.

Returns:
String: the DB name

Definition at line 349 of file Interwiki.php.

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

Returns:
Boolean

Definition at line 359 of file Interwiki.php.

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

Returns:
Boolean

Definition at line 369 of file Interwiki.php.

static Interwiki::isValidInterwiki ( prefix) [static]

Check whether an interwiki prefix exists.

Parameters:
$prefixString: interwiki prefix to use
Returns:
Boolean: whether it exists

Definition at line 36 of file Interwiki.php.

References $result, and fetch().

Referenced by Title\secureAndSplit().

Here is the call graph for this function:

Here is the caller graph for this function:

static Interwiki::load ( prefix) [static, protected]

Load the interwiki, trying first memcached then the DB.

Parameters:
$prefixstring The interwiki prefix
Returns:
Boolean: the prefix is valid

Definition at line 142 of file Interwiki.php.

References $wgInterwikiExpiry, $wgMemc, loadFromArray(), wfGetDB(), wfMemcKey(), and wfRunHooks().

Referenced by fetch().

Here is the call graph for this function:

Here is the caller graph for this function:

static Interwiki::loadFromArray ( mc) [static, protected]

Fill in member variables from an array (e.g.

memcached result, Database::fetchRow, etc)

Parameters:
$mcarray Associative array: row from the interwiki table
Returns:
Boolean|Interwiki whether everything was there

Definition at line 192 of file Interwiki.php.

Referenced by load().

Here is the caller graph for this function:


Member Data Documentation

Interwiki::$mAPI

Definition at line 19 of file Interwiki.php.

Interwiki::$mLocal

Definition at line 19 of file Interwiki.php.

Interwiki::$mPrefix [protected]

Definition at line 19 of file Interwiki.php.

Interwiki::$mTrans

Definition at line 19 of file Interwiki.php.

Interwiki::$mURL

Definition at line 19 of file Interwiki.php.

Interwiki::$mWikiID

Definition at line 19 of file Interwiki.php.

Interwiki::$smCache = array() [static, protected]

Definition at line 16 of file Interwiki.php.

Definition at line 17 of file Interwiki.php.


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