MediaWiki
master
|
Public Member Functions | |
__construct ( $type=self::TYPE_UNKNOWN) | |
__serialize () | |
__unserialize ( $fields) | |
addInterwikiId ( $identifier) | |
Adds an interwiki id to the site. More... | |
addLocalId ( $type, $identifier) | |
Adds a local identifier. More... | |
addNavigationId ( $identifier) | |
Adds a navigation id to the site. More... | |
getAllPaths () | |
Returns the paths as associative array. More... | |
getDomain () | |
Returns the domain of the site, ie en.wikipedia.org Or false if it's not known. More... | |
getExtraConfig () | |
Returns the type specific config. More... | |
getExtraData () | |
Returns the type specific fields. More... | |
getGlobalId () | |
Returns the global site identifier (ie enwiktionary). More... | |
getGroup () | |
Gets the group of the site (ie wikipedia). More... | |
getInternalId () | |
Returns the set internal identifier for the site. More... | |
getInterwikiIds () | |
Returns the interwiki link identifiers that can be used for this site. More... | |
getLanguageCode () | |
Returns language code of the sites primary language. More... | |
getLinkPath () | |
Returns the path used to construct links with or false if there is no such path. More... | |
getLinkPathType () | |
Returns the main path type, that is the type of the path that should generally be used to construct links to the target site. More... | |
getLocalIds () | |
Returns all local ids. More... | |
getNavigationIds () | |
Returns the equivalent link identifiers that can be used to make the site show up in interfaces such as the "language links" section. More... | |
getPageUrl ( $pageName=false) | |
Returns the full URL for the given page on the site. More... | |
getPath ( $pathType) | |
Returns the path of the provided type or false if there is no such path. More... | |
getProtocol () | |
Returns the protocol of the site. More... | |
getSource () | |
Returns the source of the site data (ie 'local', 'wikidata', 'my-magical-repo'). More... | |
getType () | |
Returns the type of the site (ie mediawiki). More... | |
normalizePageName ( $pageName, $followRedirect=MediaWikiPageNameNormalizer::FOLLOW_REDIRECT) | |
Attempt to normalize the page name in some fashion. More... | |
removePath ( $pathType) | |
Removes the path of the provided type if it's set. More... | |
serialize () | |
setExtraConfig (array $extraConfig) | |
Sets the type specific config. More... | |
setExtraData (array $extraData) | |
Sets the type specific fields. More... | |
setForward ( $shouldForward) | |
Sets if site.tld/path/key:pageTitle should forward users to the page on the actual site, where "key" is the local identifier. More... | |
setGlobalId ( $globalId) | |
Sets the global site identifier (ie enwiktionary). More... | |
setGroup ( $group) | |
Sets the group of the site (ie wikipedia). More... | |
setInternalId ( $internalId=null) | |
Sets the internal identifier for the site. More... | |
setLanguageCode ( $languageCode) | |
Sets language code of the sites primary language. More... | |
setLinkPath ( $fullUrl) | |
Sets the path used to construct links with. More... | |
setPath ( $pathType, $fullUrl) | |
Sets the path used to construct links with. More... | |
setSource ( $source) | |
Sets the source of the site data (ie 'local', 'wikidata', 'my-magical-repo'). More... | |
shouldForward () | |
Gets if site.tld/path/key:pageTitle should forward users to the page on the actual site, where "key" is the local identifier. More... | |
unserialize ( $serialized) | |
Static Public Member Functions | |
static | newForType ( $siteType) |
Public Attributes | |
const | GROUP_NONE = 'none' |
const | ID_EQUIVALENT = 'equivalent' |
const | ID_INTERWIKI = 'interwiki' |
const | PATH_LINK = 'link' |
const | SOURCE_LOCAL = 'local' |
const | TYPE_MEDIAWIKI = 'mediawiki' |
const | TYPE_UNKNOWN = 'unknown' |
Protected Attributes | |
array | $extraConfig = [] |
array | $extraData = [] |
bool | $forward = false |
string null | $globalId = null |
string | $group = self::GROUP_NONE |
int null | $internalId = null |
string null | $languageCode = null |
string[][] false | $localIds = [] |
Holds the local ids for this site. More... | |
string | $source = self::SOURCE_LOCAL |
string | $type = self::TYPE_UNKNOWN |
Site::__construct | ( | $type = self::TYPE_UNKNOWN | ) |
string | $type |
Reimplemented in MediaWikiSite.
Definition at line 133 of file Site.php.
References $type.
Site::__serialize | ( | ) |
Site::__unserialize | ( | $fields | ) |
Site::addInterwikiId | ( | $identifier | ) |
Adds an interwiki id to the site.
string | $identifier |
Definition at line 535 of file Site.php.
References addLocalId().
Site::addLocalId | ( | $type, | |
$identifier | |||
) |
Adds a local identifier.
string | $type | |
string | $identifier |
Definition at line 514 of file Site.php.
References $type.
Referenced by addInterwikiId(), and addNavigationId().
Site::addNavigationId | ( | $identifier | ) |
Adds a navigation id to the site.
string | $identifier |
Definition at line 546 of file Site.php.
References addLocalId().
Site::getAllPaths | ( | ) |
Returns the paths as associative array.
The keys are path types, the values are the path urls.
Definition at line 633 of file Site.php.
Referenced by SiteExporter\exportSite(), and getPath().
Site::getDomain | ( | ) |
Returns the domain of the site, ie en.wikipedia.org Or false if it's not known.
Definition at line 270 of file Site.php.
References $path, and getLinkPath().
Site::getExtraConfig | ( | ) |
Returns the type specific config.
Definition at line 438 of file Site.php.
References $extraConfig.
Site::getExtraData | ( | ) |
Returns the type specific fields.
Definition at line 416 of file Site.php.
References $extraData.
Site::getGlobalId | ( | ) |
Returns the global site identifier (ie enwiktionary).
Definition at line 144 of file Site.php.
References $globalId.
Referenced by SiteExporter\exportSite(), MediaWiki\Interwiki\InterwikiLookupAdapter\getSiteInterwikis(), and HashSiteStore\saveSite().
Site::getGroup | ( | ) |
Gets the group of the site (ie wikipedia).
Definition at line 183 of file Site.php.
References $group.
Referenced by SiteExporter\exportSite().
Site::getInternalId | ( | ) |
Returns the set internal identifier for the site.
Definition at line 490 of file Site.php.
References $internalId.
Site::getInterwikiIds | ( | ) |
Returns the interwiki link identifiers that can be used for this site.
Definition at line 557 of file Site.php.
References ID_INTERWIKI.
Referenced by MediaWiki\Interwiki\InterwikiLookupAdapter\getSiteInterwikis().
Site::getLanguageCode | ( | ) |
Returns language code of the sites primary language.
Or null if it's not known.
Definition at line 461 of file Site.php.
References $languageCode.
Site::getLinkPath | ( | ) |
Returns the path used to construct links with or false if there is no such path.
Shall be equivalent to getPath( getLinkPathType() ).
Definition at line 338 of file Site.php.
References $type, getLinkPathType(), and getPath().
Referenced by getDomain(), MediaWikiSite\getPageUrl(), getPageUrl(), and getProtocol().
Site::getLinkPathType | ( | ) |
Returns the main path type, that is the type of the path that should generally be used to construct links to the target site.
This default implementation returns Site::PATH_LINK as the default path type. Subclasses can override this to define a different default path type, or return false to disable site links.
Reimplemented in MediaWikiSite.
Definition at line 355 of file Site.php.
References PATH_LINK.
Referenced by getLinkPath(), and setLinkPath().
Site::getLocalIds | ( | ) |
Returns all local ids.
Definition at line 584 of file Site.php.
References $localIds.
Referenced by SiteExporter\exportSite().
Site::getNavigationIds | ( | ) |
Returns the equivalent link identifiers that can be used to make the site show up in interfaces such as the "language links" section.
Definition at line 571 of file Site.php.
References ID_EQUIVALENT.
Site::getPageUrl | ( | $pageName = false | ) |
Returns the full URL for the given page on the site.
Or null if the needed information is not known.
This generated URL is usually based upon the path returned by getLinkPath(), but this is not a requirement.
This implementation returns a URL constructed using the path returned by getLinkPath().
bool | string | $pageName |
Reimplemented in MediaWikiSite.
Definition at line 374 of file Site.php.
References getLinkPath().
Referenced by MediaWiki\Interwiki\InterwikiLookupAdapter\getSiteInterwikis().
Site::getPath | ( | $pathType | ) |
Returns the path of the provided type or false if there is no such path.
string | $pathType |
Definition at line 620 of file Site.php.
References getAllPaths().
Referenced by MediaWikiSite\getFileUrl(), getLinkPath(), MediaWikiSite\getRelativeFilePath(), and MediaWikiSite\getRelativePagePath().
Site::getProtocol | ( | ) |
Returns the protocol of the site.
MWException |
Definition at line 288 of file Site.php.
References $path, and getLinkPath().
Site::getSource | ( | ) |
Returns the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').
Definition at line 211 of file Site.php.
References $source.
Referenced by SiteExporter\exportSite(), and MediaWiki\Interwiki\InterwikiLookupAdapter\getSiteInterwikis().
Site::getType | ( | ) |
Returns the type of the site (ie mediawiki).
Definition at line 172 of file Site.php.
References $type.
Referenced by SiteExporter\exportSite().
|
static |
string | $siteType |
Definition at line 657 of file Site.php.
Referenced by DBSiteStore\loadSites(), and SiteImporter\makeSite().
Site::normalizePageName | ( | $pageName, | |
$followRedirect = MediaWikiPageNameNormalizer::FOLLOW_REDIRECT |
|||
) |
Attempt to normalize the page name in some fashion.
May return false to indicate various kinds of failure.
This implementation returns $pageName without changes.
string | $pageName | |
int | $followRedirect | either MediaWikiPageNameNormalizer::FOLLOW_REDIRECT or MediaWikiPageNameNormalizer::NOFOLLOW_REDIRECT |
Reimplemented in MediaWikiSite.
Site::removePath | ( | $pathType | ) |
Site::serialize | ( | ) |
Site::setExtraConfig | ( | array | $extraConfig | ) |
Sets the type specific config.
array | $extraConfig |
Definition at line 449 of file Site.php.
References $extraConfig.
Site::setExtraData | ( | array | $extraData | ) |
Sets the type specific fields.
array | $extraData |
Definition at line 427 of file Site.php.
References $extraData.
Site::setForward | ( | $shouldForward | ) |
Sets if site.tld/path/key:pageTitle should forward users to the page on the actual site, where "key" is the local identifier.
bool | $shouldForward |
MWException |
Site::setGlobalId | ( | $globalId | ) |
Sets the global site identifier (ie enwiktionary).
string | null | $globalId |
MWException |
Definition at line 157 of file Site.php.
References $globalId.
Site::setGroup | ( | $group | ) |
Sets the group of the site (ie wikipedia).
string | $group |
MWException |
Definition at line 196 of file Site.php.
References $group.
Site::setInternalId | ( | $internalId = null | ) |
Sets the internal identifier for the site.
This typically is a primary key in a db table.
int | null | $internalId |
Definition at line 502 of file Site.php.
References $internalId.
Site::setLanguageCode | ( | $languageCode | ) |
Sets language code of the sites primary language.
string | null | $languageCode |
Definition at line 472 of file Site.php.
References $languageCode.
Site::setLinkPath | ( | $fullUrl | ) |
Sets the path used to construct links with.
Shall be equivalent to setPath( getLinkPathType(), $fullUrl ).
string | $fullUrl |
MWException |
Definition at line 321 of file Site.php.
References $type, getLinkPathType(), and setPath().
Site::setPath | ( | $pathType, | |
$fullUrl | |||
) |
Sets the path used to construct links with.
Shall be equivalent to setPath( getLinkPathType(), $fullUrl ).
string | $pathType | |
string | $fullUrl |
MWException |
Definition at line 599 of file Site.php.
Referenced by MediaWikiSite\setFilePath(), setLinkPath(), and MediaWikiSite\setPagePath().
Site::setSource | ( | $source | ) |
Sets the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').
string | $source |
MWException |
Definition at line 224 of file Site.php.
References $source.
Site::shouldForward | ( | ) |
Gets if site.tld/path/key:pageTitle should forward users to the page on the actual site, where "key" is the local identifier.
Definition at line 240 of file Site.php.
References $forward.
Referenced by SiteExporter\exportSite().
Site::unserialize | ( | $serialized | ) |
|
protected |
Definition at line 112 of file Site.php.
Referenced by getExtraConfig(), and setExtraConfig().
|
protected |
Definition at line 105 of file Site.php.
Referenced by getExtraData(), and setExtraData().
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 126 of file Site.php.
Referenced by getInternalId(), and setInternalId().
|
protected |
Definition at line 88 of file Site.php.
Referenced by getLanguageCode(), and setLanguageCode().
|
protected |
Holds the local ids for this site.
local id type => [ ids for this type (strings) ]
Definition at line 98 of file Site.php.
Referenced by getLocalIds().
|
protected |
|
protected |
Definition at line 67 of file Site.php.
Referenced by MediaWikiSite\__construct(), __construct(), addLocalId(), getLinkPath(), getType(), and setLinkPath().
const Site::GROUP_NONE = 'none' |
Definition at line 37 of file Site.php.
Referenced by SiteExporter\exportSite(), and SiteImporter\makeSite().
const Site::ID_EQUIVALENT = 'equivalent' |
Definition at line 40 of file Site.php.
Referenced by getNavigationIds().
const Site::ID_INTERWIKI = 'interwiki' |
Definition at line 39 of file Site.php.
Referenced by getInterwikiIds().
const Site::PATH_LINK = 'link' |
Definition at line 44 of file Site.php.
Referenced by getLinkPathType().
const Site::SOURCE_LOCAL = 'local' |
Definition at line 42 of file Site.php.
Referenced by SiteExporter\exportSite(), and SiteImporter\makeSite().
const Site::TYPE_UNKNOWN = 'unknown' |
Definition at line 34 of file Site.php.
Referenced by SiteExporter\exportSite(), and SiteImporter\makeSite().