MediaWiki
REL1_19
|
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. | |
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 13 of file Interwiki.php.
Interwiki::__construct | ( | $ | prefix = null , |
$ | url = '' , |
||
$ | api = '' , |
||
$ | wikiId = '' , |
||
$ | local = 0 , |
||
$ | trans = 0 |
||
) |
Definition at line 21 of file Interwiki.php.
References $url.
static Interwiki::fetch | ( | $ | prefix | ) | [static] |
Fetch an Interwiki object.
$prefix | String: interwiki prefix to use |
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().
static Interwiki::getAllPrefixes | ( | $ | local = null | ) | [static] |
Returns all interwiki prefixes.
$local | string|null If set, limits output to local/non-local interwikis |
Definition at line 308 of file Interwiki.php.
References $wgInterwikiCache, getAllPrefixesCached(), and getAllPrefixesDB().
Referenced by ApiQuerySiteinfo\appendInterwikiMap().
static Interwiki::getAllPrefixesCached | ( | $ | local | ) | [static, protected] |
Fetch all interwiki prefixes from interwiki cache.
$local | null|string If not null, limits output to local/non-local interwikis |
Definition at line 213 of file Interwiki.php.
References $wgInterwikiCache, $wgInterwikiFallbackSite, $wgInterwikiScopes, CdbReader\open(), wfDebug(), and wfWikiID().
Referenced by getAllPrefixes().
static Interwiki::getAllPrefixesDB | ( | $ | local | ) | [static, protected] |
Fetch all interwiki prefixes from DB.
$local | string|null If not null, limits output to local/non-local interwikis |
Definition at line 277 of file Interwiki.php.
References $res, and wfGetDB().
Referenced by getAllPrefixes().
Get the API URL for this wiki.
Definition at line 340 of file Interwiki.php.
Get a description for this interwiki.
Definition at line 388 of file Interwiki.php.
References wfMessage().
static Interwiki::getInterwikiCached | ( | $ | prefix | ) | [static, protected] |
Fetch interwiki prefix data from local cache in constant database.
$prefix | String: interwiki prefix |
Definition at line 81 of file Interwiki.php.
References $url, and getInterwikiCacheEntry().
Referenced by fetch().
static Interwiki::getInterwikiCacheEntry | ( | $ | prefix | ) | [static, protected] |
Get entry from interwiki cache.
$prefix | String: database key |
Definition at line 104 of file Interwiki.php.
References $wgInterwikiCache, $wgInterwikiFallbackSite, $wgInterwikiScopes, CdbReader\open(), wfDebug(), wfMemcKey(), and wfWikiID().
Referenced by getInterwikiCached().
Get the name for the interwiki site.
Definition at line 378 of file Interwiki.php.
References wfMessage().
Interwiki::getURL | ( | $ | title = null | ) |
Get the URL for a particular title (or with $1 if no title given)
$title | String: what text to put for the article name |
Definition at line 327 of file Interwiki.php.
References $title, $url, and wfUrlencode().
Get the DB name for this wiki.
Definition at line 349 of file Interwiki.php.
Is this a local link from a sister project, or is it something outside, like Google.
Definition at line 359 of file Interwiki.php.
Can pages from this wiki be transcluded? Still requires $wgEnableScaryTransclusion.
Definition at line 369 of file Interwiki.php.
static Interwiki::isValidInterwiki | ( | $ | prefix | ) | [static] |
Check whether an interwiki prefix exists.
$prefix | String: interwiki prefix to use |
Definition at line 36 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.
$prefix | string The interwiki prefix |
Definition at line 142 of file Interwiki.php.
References $wgInterwikiExpiry, $wgMemc, 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)
$mc | array Associative array: row from the interwiki table |
Definition at line 192 of file Interwiki.php.
Referenced by load().
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.
const Interwiki::CACHE_LIMIT = 100 |
Definition at line 17 of file Interwiki.php.