MediaWiki
1.27.2
|
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. More... | |
getDescription () | |
Get a description for this interwiki. More... | |
getName () | |
Get the name for the interwiki site. More... | |
getURL ($title=null) | |
Get the URL for a particular title (or with $1 if no title given) More... | |
getWikiID () | |
Get the DB name for this wiki. More... | |
isLocal () | |
Is this a local link from a sister project, or is it something outside, like Google. More... | |
isTranscludable () | |
Can pages from this wiki be transcluded? Still requires $wgEnableScaryTransclusion. More... | |
Static Public Member Functions | |
static | fetch ($prefix) |
Fetch an Interwiki object. More... | |
static | getAllPrefixes ($local=null) |
Returns all interwiki prefixes. More... | |
static | invalidateCache ($prefix) |
Purge the cache (local and persistent) for an interwiki prefix. More... | |
static | isValidInterwiki ($prefix) |
Check whether an interwiki prefix exists. More... | |
static | resetLocalCache () |
Resets locally cached Interwiki objects. More... | |
static | selectFields () |
Return the list of interwiki fields that should be selected to create a new Interwiki object. More... | |
Public Attributes | |
const | CACHE_LIMIT = 100 |
Static Protected Member Functions | |
static | getAllPrefixesCached ($local) |
Fetch all interwiki prefixes from interwiki cache. More... | |
static | getAllPrefixesDB ($local) |
Fetch all interwiki prefixes from DB. More... | |
static | getInterwikiCached ($prefix) |
Fetch interwiki prefix data from local cache in constant database. More... | |
static | getInterwikiCacheEntry ($prefix) |
Get entry from interwiki cache. More... | |
static | load ($prefix) |
Load the interwiki, trying first memcached then the DB. More... | |
static | loadFromArray ($mc) |
Fill in member variables from an array (e.g. More... | |
Protected Attributes | |
string | $mAPI |
The URL of the file api.php. More... | |
bool | $mLocal |
Whether the wiki is in this project. More... | |
string | $mPrefix |
The interwiki prefix, (e.g. More... | |
bool | $mTrans |
Whether interwiki transclusions are allowed. More... | |
string | $mURL |
The URL of the wiki, with "$1" as a placeholder for an article name. More... | |
string | $mWikiID |
The name of the database (for a connection to be established with wfGetLB( 'wikiid' )) More... | |
Static Protected Attributes | |
static | $smCache = [] |
Static Private Member Functions | |
static | getCacheValue ($key) |
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 31 of file Interwiki.php.
Interwiki::__construct | ( | $prefix = null , |
|
$url = '' , |
|||
$api = '' , |
|||
$wikiId = '' , |
|||
$local = 0 , |
|||
$trans = 0 |
|||
) |
Definition at line 56 of file Interwiki.php.
|
static |
Fetch an Interwiki object.
string | $prefix | Interwiki prefix to use |
Definition at line 85 of file Interwiki.php.
References $wgContLang, $wgInterwikiCache, getInterwikiCached(), global, key, and load().
Referenced by Title\getLocalURL(), Title\getTransWikiID(), Title\isLocal(), Title\isTrans(), ImportStreamSource\newFromInterwiki(), InterwikiTest\testArrayStorage(), InterwikiTest\testCDBStorage(), and InterwikiTest\testDatabaseStorage().
|
static |
Returns all interwiki prefixes.
string | null | $local | If set, limits output to local/non-local interwikis |
Definition at line 392 of file Interwiki.php.
References $wgInterwikiCache, and global.
Referenced by ApiQuerySiteinfo\appendInterwikiMap(), NamespaceConflictChecker\getInterwikiList(), InterwikiTest\testArrayStorage(), InterwikiTest\testCDBStorage(), and InterwikiTest\testDatabaseStorage().
|
staticprotected |
Fetch all interwiki prefixes from interwiki cache.
null | string | $local | If not null, limits output to local/non-local interwikis |
Definition at line 293 of file Interwiki.php.
References $e, $source, $wgInterwikiFallbackSite, $wgInterwikiScopes, as, global, list, wfDebug(), and wfWikiID().
|
staticprotected |
Interwiki::getAPI | ( | ) |
Get the API URL for this wiki.
Definition at line 425 of file Interwiki.php.
References $mAPI.
|
staticprivate |
Definition at line 205 of file Interwiki.php.
References $key, $wgInterwikiCache, global, and Makefile\open.
Interwiki::getDescription | ( | ) |
Get a description for this interwiki.
Definition at line 474 of file Interwiki.php.
References wfMessage().
|
staticprotected |
|
staticprotected |
Get entry from interwiki cache.
string | $prefix | Database key |
Definition at line 170 of file Interwiki.php.
References $e, $value, $wgInterwikiFallbackSite, $wgInterwikiScopes, global, wfDebug(), wfMemcKey(), and wfWikiID().
Interwiki::getName | ( | ) |
Get the name for the interwiki site.
Definition at line 463 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 411 of file Interwiki.php.
References $mURL, $title, and wfUrlencode().
Interwiki::getWikiID | ( | ) |
Get the DB name for this wiki.
Definition at line 434 of file Interwiki.php.
References $mWikiID.
|
static |
Purge the cache (local and persistent) for an interwiki prefix.
string | $prefix |
Definition at line 131 of file Interwiki.php.
References $cache, $key, ObjectCache\getMainWANInstance(), and wfMemcKey().
Referenced by InterwikiTest\testDatabaseStorage().
Interwiki::isLocal | ( | ) |
Is this a local link from a sister project, or is it something outside, like Google.
Definition at line 444 of file Interwiki.php.
References $mLocal.
Interwiki::isTranscludable | ( | ) |
Can pages from this wiki be transcluded? Still requires $wgEnableScaryTransclusion.
Definition at line 454 of file Interwiki.php.
References $mTrans.
|
static |
Check whether an interwiki prefix exists.
string | $prefix | Interwiki prefix to use |
Definition at line 73 of file Interwiki.php.
Referenced by MediaWikiTitleCodec\splitTitleString(), InterwikiTest\testArrayStorage(), InterwikiTest\testCDBStorage(), and InterwikiTest\testDatabaseStorage().
|
staticprotected |
Load the interwiki, trying first memcached then the DB.
string | $prefix | The interwiki prefix |
Definition at line 224 of file Interwiki.php.
References $dbr, $wgInterwikiExpiry, array(), DB_SLAVE, DatabaseBase\getCacheSetOptions(), ObjectCache\getMainWANInstance(), global, loadFromArray(), Hooks\run(), selectFields(), use, wfGetDB(), and wfMemcKey().
Referenced by fetch().
|
staticprotected |
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 271 of file Interwiki.php.
Referenced by load().
|
static |
Resets locally cached Interwiki objects.
This is intended for use during testing only. This does not invalidate entries in the persistent cache, as invalidateCache() does.
Definition at line 122 of file Interwiki.php.
Referenced by InterwikiTest\testArrayStorage(), InterwikiTest\testCDBStorage(), and InterwikiTest\testDatabaseStorage().
|
static |
Return the list of interwiki fields that should be selected to create a new Interwiki object.
Definition at line 485 of file Interwiki.php.
Referenced by load().
|
protected |
|
protected |
Whether the wiki is in this project.
Definition at line 51 of file Interwiki.php.
Referenced by isLocal().
|
protected |
The interwiki prefix, (e.g.
"Meatball", or the language prefix "de")
Definition at line 37 of file Interwiki.php.
|
protected |
Whether interwiki transclusions are allowed.
Definition at line 54 of file Interwiki.php.
Referenced by isTranscludable().
|
protected |
The URL of the wiki, with "$1" as a placeholder for an article name.
Definition at line 40 of file Interwiki.php.
Referenced by getURL().
|
protected |
The name of the database (for a connection to be established with wfGetLB( 'wikiid' ))
Definition at line 48 of file Interwiki.php.
Referenced by getWikiID().
|
staticprotected |
Definition at line 33 of file Interwiki.php.
const Interwiki::CACHE_LIMIT = 100 |
Definition at line 34 of file Interwiki.php.