|
MediaWiki
REL1_20
|
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 37 of file Interwiki.php.
References $url.
| static Interwiki::fetch | ( | $ | prefix | ) | [static] |
Fetch an Interwiki object.
| $prefix | String: interwiki prefix to use |
Definition at line 63 of file Interwiki.php.
References $wgContLang, 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 325 of file Interwiki.php.
References 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 230 of file Interwiki.php.
References $source, 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 294 of file Interwiki.php.
References $res, and wfGetDB().
Referenced by getAllPrefixes().
Get the API URL for this wiki.
Definition at line 357 of file Interwiki.php.
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.
| $prefix | String: interwiki prefix |
Definition at line 97 of file Interwiki.php.
References $s, $url, $value, and getInterwikiCacheEntry().
Referenced by fetch().
| static Interwiki::getInterwikiCacheEntry | ( | $ | prefix | ) | [static, protected] |
Get entry from interwiki cache.
| $prefix | String: database key |
Definition at line 120 of file Interwiki.php.
References $value, 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)
| $title | String: what text to put for the article name |
Definition at line 344 of file Interwiki.php.
References $title, $url, 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.
| $prefix | String: interwiki prefix to use |
Definition at line 52 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 159 of file Interwiki.php.
References $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 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.
| Interwiki::$mAPI |
Definition at line 35 of file Interwiki.php.
| Interwiki::$mLocal |
Definition at line 35 of file Interwiki.php.
Interwiki::$mPrefix [protected] |
Definition at line 35 of file Interwiki.php.
| Interwiki::$mTrans |
Definition at line 35 of file Interwiki.php.
| Interwiki::$mURL |
Definition at line 35 of file Interwiki.php.
| Interwiki::$mWikiID |
Definition at line 35 of file Interwiki.php.
Interwiki::$smCache = array() [static, protected] |
Definition at line 32 of file Interwiki.php.
| const Interwiki::CACHE_LIMIT = 100 |
Definition at line 33 of file Interwiki.php.