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 ()
 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.
 getName ()
 Get the name for the interwiki site.
 getDescription ()
 Get a description for this interwiki.

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 $url.


Member Function Documentation

static Interwiki::fetch ( prefix  )  [static]

Fetch an Interwiki object.

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

Definition at line 44 of file Interwiki.php.

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

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

Interwiki::getDescription (  ) 

Get a description for this interwiki.

Returns:
String

Definition at line 231 of file Interwiki.php.

References $msg, wfEmptyMsg(), and wfMsgForContent().

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:
Interwiki object

Definition at line 78 of file Interwiki.php.

References $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 101 of file Interwiki.php.

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

Referenced by getInterwikiCached().

Interwiki::getName (  ) 

Get the name for the interwiki site.

Returns:
String

Definition at line 220 of file Interwiki.php.

References $msg, wfEmptyMsg(), and wfMsgForContent().

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 187 of file Interwiki.php.

References $title, and $url.

Interwiki::isLocal (  ) 

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

Returns:
Boolean

Definition at line 201 of file Interwiki.php.

Interwiki::isTranscludable (  ) 

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

Returns:
Boolean

Definition at line 211 of file Interwiki.php.

static Interwiki::isValidInterwiki ( prefix  )  [static]

Check whether an interwiki prefix exists.

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

Definition at line 33 of file Interwiki.php.

References $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:
Boolean: the prefix is valid

Definition at line 138 of file Interwiki.php.

References $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)

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

Definition at line 170 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 Apr 30 22:57:39 2011 for MediaWiki by  doxygen 1.5.9