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= '', $local=0, $trans=0)
 getURL ($title=null)
 Get the URL for a particular title (or with $1 if no title given).
 isLocal ()
 isTranscludable ()

Static Public Member Functions

static isValidInterwiki ($prefix)
 Check whether an interwiki prefix exists.
static fetch ($prefix)
 Fetch an Interwiki object.

Public Attributes

const CACHE_LIMIT = 100

Static Protected Member Functions

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
 $mURL
 $mLocal
 $mTrans

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 arent wiki-related)

Definition at line 12 of file Interwiki.php.


Constructor & Destructor Documentation

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

Definition at line 20 of file Interwiki.php.

References $prefix, and $url.


Member Function Documentation

static Interwiki::fetch ( prefix  )  [static]

Fetch an Interwiki object.

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

Definition at line 45 of file Interwiki.php.

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

Referenced by Title::getFullURL(), Title::getInterwikiLink(), Title::isLocal(), Title::isTrans(), and isValidInterwiki().

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

Fetch interwiki prefix data from local cache in constant database.

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

Definition at line 79 of file Interwiki.php.

References $prefix, $s, $url, and getInterwikiCacheEntry().

Referenced by fetch().

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

Get entry from interwiki cache.

Note:
More logic is explained in DefaultSettings.
Parameters:
$prefix  String : : Database key
Returns:
{ String :) The entry

Definition at line 102 of file Interwiki.php.

References $db, $prefix, $wgInterwikiCache, $wgInterwikiFallbackSite, $wgInterwikiScopes, wfDebug(), wfMemcKey(), and wfWikiID().

Referenced by getInterwikiCached().

Interwiki::getURL ( title = null  ) 

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

Parameters:
$title string What text to put for the article name
Returns:
string The URL

Definition at line 191 of file Interwiki.php.

References $title, and $url.

Interwiki::isLocal (  ) 

Definition at line 199 of file Interwiki.php.

Interwiki::isTranscludable (  ) 

Definition at line 203 of file Interwiki.php.

static Interwiki::isValidInterwiki ( prefix  )  [static]

Check whether an interwiki prefix exists.

Returns:
bool Whether it exists
Parameters:
$prefix string Interwiki prefix to use

Definition at line 34 of file Interwiki.php.

References $prefix, $result, and fetch().

Referenced by Title::secureAndSplit().

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

Load the interwiki, trying first memcached then the DB.

Parameters:
$prefix The interwiki prefix
Returns:
bool The prefix is valid

Definition at line 141 of file Interwiki.php.

References $db, $key, $prefix, $row, $wgInterwikiExpiry, $wgMemc, loadFromArray(), wfGetDB(), and wfMemcKey().

Referenced by fetch().

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

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

memcached result, Database::fetchRow, etc)

Returns:
bool Whether everything was there
Parameters:
$res ResultWrapper Row from the interwiki table

Definition at line 174 of file Interwiki.php.

Referenced by load().


Member Data Documentation

Interwiki::$mLocal [protected]

Definition at line 18 of file Interwiki.php.

Interwiki::$mPrefix [protected]

Definition at line 18 of file Interwiki.php.

Interwiki::$mTrans [protected]

Definition at line 18 of file Interwiki.php.

Interwiki::$mURL [protected]

Definition at line 18 of file Interwiki.php.

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

Definition at line 15 of file Interwiki.php.

Definition at line 16 of file Interwiki.php.


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

Generated on Sat Sep 5 02:08:39 2009 for MediaWiki by  doxygen 1.5.9