MediaWiki
REL1_22
|
The interwiki class All information is loaded on creation when called by Interwiki::fetch( $prefix ). More...
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. | |
static | selectFields () |
Return the list of interwiki fields that should be selected to create a new Interwiki object. | |
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() |
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 29 of file Interwiki.php.
Interwiki::__construct | ( | $ | prefix = null , |
$ | url = '' , |
||
$ | api = '' , |
||
$ | wikiId = '' , |
||
$ | local = 0 , |
||
$ | trans = 0 |
||
) |
Definition at line 36 of file Interwiki.php.
static Interwiki::fetch | ( | $ | prefix | ) | [static] |
Fetch an Interwiki object.
string | $prefix | Interwiki prefix to use |
Definition at line 64 of file Interwiki.php.
References $wgContLang, getInterwikiCached(), global, key, and load().
Referenced by Title\getLocalURL(), Title\getTransWikiID(), Title\isLocal(), Title\isTrans(), and isValidInterwiki().
static Interwiki::getAllPrefixes | ( | $ | local = null | ) | [static] |
Returns all interwiki prefixes.
string | null | $local | If set, limits output to local/non-local interwikis |
Definition at line 325 of file Interwiki.php.
References getAllPrefixesCached(), getAllPrefixesDB(), and global.
Referenced by ApiQuerySiteinfo\appendInterwikiMap().
static Interwiki::getAllPrefixesCached | ( | $ | local | ) | [static, protected] |
Fetch all interwiki prefixes from interwiki cache.
null | string | $local | If not null, limits output to local/non-local interwikis |
Definition at line 230 of file Interwiki.php.
References $source, array(), as, global, list, CdbReader\open(), wfDebug(), and wfWikiID().
Referenced by getAllPrefixes().
static Interwiki::getAllPrefixesDB | ( | $ | local | ) | [static, protected] |
Fetch all interwiki prefixes from DB.
string | null | $local | If not null, limits output to local/non-local interwikis |
Definition at line 294 of file Interwiki.php.
References $res, $retval, array(), as, and wfGetDB().
Referenced by getAllPrefixes().
Get a description for this interwiki.
Definition at line 405 of file Interwiki.php.
References wfMessage().
static Interwiki::getInterwikiCached | ( | $ | prefix | ) | [static, protected] |
Fetch interwiki prefix data from local cache in constant database.
string | $prefix | Interwiki prefix |
Definition at line 98 of file Interwiki.php.
References $s, $value, getInterwikiCacheEntry(), and list.
Referenced by fetch().
static Interwiki::getInterwikiCacheEntry | ( | $ | prefix | ) | [static, protected] |
Get entry from interwiki cache.
string | $prefix | Database key |
Definition at line 121 of file Interwiki.php.
References $value, global, CdbReader\open(), wfDebug(), wfMemcKey(), and wfWikiID().
Referenced by getInterwikiCached().
Get the name for the interwiki site.
Definition at line 395 of file Interwiki.php.
References wfMessage().
Interwiki::getURL | ( | $ | title = null | ) |
Get the URL for a particular title (or with $1 if no title given)
string | $title | What text to put for the article name |
Definition at line 344 of file Interwiki.php.
References $title, and wfUrlencode().
Get the DB name for this wiki.
Definition at line 366 of file Interwiki.php.
Is this a local link from a sister project, or is it something outside, like Google.
Definition at line 376 of file Interwiki.php.
Can pages from this wiki be transcluded? Still requires $wgEnableScaryTransclusion.
Definition at line 386 of file Interwiki.php.
static Interwiki::isValidInterwiki | ( | $ | prefix | ) | [static] |
Check whether an interwiki prefix exists.
string | $prefix | Interwiki prefix to use |
Definition at line 53 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.
string | $prefix | The interwiki prefix |
Definition at line 159 of file Interwiki.php.
References $key, $wgMemc, array(), global, loadFromArray(), wfGetDB(), wfMemcKey(), and wfRunHooks().
Referenced by fetch().
static Interwiki::loadFromArray | ( | $ | mc | ) | [static, protected] |
Fill in member variables from an array (e.g.
memcached result, Database::fetchRow, etc)
array | $mc | Associative array: row from the interwiki table |
Definition at line 209 of file Interwiki.php.
Referenced by load().
static Interwiki::selectFields | ( | ) | [static] |
Return the list of interwiki fields that should be selected to create a new Interwiki object.
Definition at line 415 of file Interwiki.php.
References array().
Interwiki::$mAPI |
Definition at line 34 of file Interwiki.php.
Interwiki::$mLocal |
Definition at line 34 of file Interwiki.php.
Interwiki::$mPrefix [protected] |
Definition at line 34 of file Interwiki.php.
Interwiki::$mTrans |
Definition at line 34 of file Interwiki.php.
Interwiki::$mURL |
Definition at line 34 of file Interwiki.php.
Interwiki::$mWikiID |
Definition at line 34 of file Interwiki.php.
Interwiki::$smCache = array() [static, protected] |
Definition at line 31 of file Interwiki.php.
const Interwiki::CACHE_LIMIT = 100 |
Definition at line 32 of file Interwiki.php.