MediaWiki master
|
Represents a single site. More...
Inherited by MediaWiki\Site\MediaWikiSite.
Public Member Functions | |
__construct ( $type=self::TYPE_UNKNOWN) | |
__serialize () | |
__unserialize ( $fields) | |
addInterwikiId ( $identifier) | |
Adds an interwiki id to the site. | |
addLocalId ( $type, $identifier) | |
Adds a local identifier. | |
addNavigationId ( $identifier) | |
Adds a navigation id to the site. | |
getAllPaths () | |
Returns the paths as associative array. | |
getDomain () | |
Returns the domain of the site, ie en.wikipedia.org Or null if it's not known. | |
getExtraConfig () | |
Returns the type specific config. | |
getExtraData () | |
Returns the type specific fields. | |
getGlobalId () | |
Returns the global site identifier (ie enwiktionary). | |
getGroup () | |
Gets the group of the site (ie wikipedia). | |
getInternalId () | |
Returns the set internal identifier for the site. | |
getInterwikiIds () | |
Returns the interwiki link identifiers that can be used for this site. | |
getLanguageCode () | |
Returns language code of the sites primary language. | |
getLinkPath () | |
Returns the path used to construct links with or false if there is no such path. | |
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. | |
getLocalIds () | |
Returns all local ids. | |
getNavigationIds () | |
Returns the equivalent link identifiers that can be used to make the site show up in interfaces such as the "language links" section. | |
getPageUrl ( $pageName=false) | |
Get the full URL for the given page on the site. | |
getPath ( $pathType) | |
Returns the path of the provided type or null if there is no such path. | |
getProtocol () | |
Returns the protocol of the site. | |
getSource () | |
Returns the source of the site data (ie 'local', 'wikidata', 'my-magical-repo'). | |
getType () | |
Returns the type of the site (ie mediawiki). | |
normalizePageName ( $pageName, $followRedirect=MediaWikiPageNameNormalizer::FOLLOW_REDIRECT) | |
Attempt to normalize the page name in some fashion. | |
removePath ( $pathType) | |
Removes the path of the provided type if it's set. | |
setExtraConfig (array $extraConfig) | |
Sets the type specific config. | |
setExtraData (array $extraData) | |
Sets the type specific fields. | |
setForward (bool $shouldForward) | |
Sets if site.tld/path/key:pageTitle should forward users to the page on the actual site, where "key" is the local identifier. | |
setGlobalId (?string $globalId) | |
Sets the global site identifier (ie enwiktionary). | |
setGroup (string $group) | |
Sets the group of the site (ie wikipedia). | |
setInternalId ( $internalId=null) | |
Sets the internal identifier for the site. | |
setLanguageCode ( $languageCode) | |
Sets language code of the sites primary language. | |
setLinkPath ( $fullUrl) | |
Set the path used to construct links with. | |
setPath ( $pathType, string $fullUrl) | |
Set the path used to construct links with. | |
setSource (string $source) | |
Sets the source of the site data (ie 'local', 'wikidata', 'my-magical-repo'). | |
shouldForward () | |
Gets if site.tld/path/key:pageTitle should forward users to the page on the actual site, where "key" is the local identifier. | |
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. | |
string | $source = self::SOURCE_LOCAL |
string | $type = self::TYPE_UNKNOWN |
MediaWiki\Site\Site::__construct | ( | $type = self::TYPE_UNKNOWN | ) |
string | $type |
Reimplemented in MediaWiki\Site\MediaWikiSite.
Definition at line 136 of file Site.php.
References MediaWiki\Site\Site\$type.
MediaWiki\Site\Site::__serialize | ( | ) |
MediaWiki\Site\Site::__unserialize | ( | $fields | ) |
MediaWiki\Site\Site::addInterwikiId | ( | $identifier | ) |
MediaWiki\Site\Site::addLocalId | ( | $type, | |
$identifier ) |
MediaWiki\Site\Site::addNavigationId | ( | $identifier | ) |
MediaWiki\Site\Site::getAllPaths | ( | ) |
MediaWiki\Site\Site::getDomain | ( | ) |
MediaWiki\Site\Site::getExtraConfig | ( | ) |
MediaWiki\Site\Site::getExtraData | ( | ) |
MediaWiki\Site\Site::getGlobalId | ( | ) |
Returns the global site identifier (ie enwiktionary).
Definition at line 147 of file Site.php.
References MediaWiki\Site\Site\$globalId.
Referenced by MediaWiki\Site\HashSiteStore\saveSite().
MediaWiki\Site\Site::getGroup | ( | ) |
Gets the group of the site (ie wikipedia).
Definition at line 179 of file Site.php.
References MediaWiki\Site\Site\$group.
MediaWiki\Site\Site::getInternalId | ( | ) |
MediaWiki\Site\Site::getInterwikiIds | ( | ) |
MediaWiki\Site\Site::getLanguageCode | ( | ) |
MediaWiki\Site\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 310 of file Site.php.
Referenced by MediaWiki\Site\MediaWikiSite\getPageUrl().
MediaWiki\Site\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 MediaWiki\Site\MediaWikiSite.
MediaWiki\Site\Site::getLocalIds | ( | ) |
MediaWiki\Site\Site::getNavigationIds | ( | ) |
MediaWiki\Site\Site::getPageUrl | ( | $pageName = false | ) |
Get the full URL for the given page on the site.
Returns 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().
string | false | $pageName |
Reimplemented in MediaWiki\Site\MediaWikiSite.
Definition at line 345 of file Site.php.
References $url.
MediaWiki\Site\Site::getPath | ( | $pathType | ) |
Returns the path of the provided type or null if there is no such path.
string | $pathType |
Definition at line 572 of file Site.php.
Referenced by MediaWiki\Site\MediaWikiSite\getFileUrl(), MediaWiki\Site\MediaWikiSite\getRelativeFilePath(), and MediaWiki\Site\MediaWikiSite\getRelativePagePath().
MediaWiki\Site\Site::getProtocol | ( | ) |
MediaWiki\Site\Site::getSource | ( | ) |
Returns the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').
Definition at line 200 of file Site.php.
References MediaWiki\Site\Site\$source.
MediaWiki\Site\Site::getType | ( | ) |
Returns the type of the site (ie mediawiki).
Definition at line 168 of file Site.php.
References MediaWiki\Site\Site\$type.
|
static |
string | $siteType |
Definition at line 609 of file Site.php.
References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\MainConfigNames\SiteTypes.
Referenced by MediaWiki\Site\DBSiteStore\loadSites(), and MediaWiki\Site\SiteImporter\makeSite().
MediaWiki\Site\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 MediaWiki\Site\MediaWikiSite.
MediaWiki\Site\Site::removePath | ( | $pathType | ) |
MediaWiki\Site\Site::setExtraConfig | ( | array | $extraConfig | ) |
MediaWiki\Site\Site::setExtraData | ( | array | $extraData | ) |
MediaWiki\Site\Site::setForward | ( | bool | $shouldForward | ) |
MediaWiki\Site\Site::setGlobalId | ( | ?string | $globalId | ) |
Sets the global site identifier (ie enwiktionary).
string | null | $globalId |
Definition at line 157 of file Site.php.
References MediaWiki\Site\Site\$globalId.
MediaWiki\Site\Site::setGroup | ( | string | $group | ) |
Sets the group of the site (ie wikipedia).
string | $group |
Definition at line 189 of file Site.php.
References MediaWiki\Site\Site\$group.
MediaWiki\Site\Site::setInternalId | ( | $internalId = null | ) |
MediaWiki\Site\Site::setLanguageCode | ( | $languageCode | ) |
Sets language code of the sites primary language.
string | null | $languageCode |
Definition at line 443 of file Site.php.
References MediaWiki\MediaWikiServices\getInstance().
MediaWiki\Site\Site::setLinkPath | ( | $fullUrl | ) |
MediaWiki\Site\Site::setPath | ( | $pathType, | |
string | $fullUrl ) |
Set the path used to construct links with.
Shall be equivalent to setPath( getLinkPathType(), $fullUrl ).
string | $pathType | |
string | $fullUrl |
Definition at line 559 of file Site.php.
Referenced by MediaWiki\Site\MediaWikiSite\setFilePath(), and MediaWiki\Site\MediaWikiSite\setPagePath().
MediaWiki\Site\Site::setSource | ( | string | $source | ) |
Sets the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').
string | $source |
Definition at line 210 of file Site.php.
References MediaWiki\Site\Site\$source.
MediaWiki\Site\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 222 of file Site.php.
References MediaWiki\Site\Site\$forward.
|
protected |
|
protected |
|
protected |
Definition at line 122 of file Site.php.
Referenced by MediaWiki\Site\Site\shouldForward().
|
protected |
Definition at line 63 of file Site.php.
Referenced by MediaWiki\Site\Site\getGlobalId(), and MediaWiki\Site\Site\setGlobalId().
|
protected |
Definition at line 77 of file Site.php.
Referenced by MediaWiki\Site\Site\getGroup(), and MediaWiki\Site\Site\setGroup().
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 84 of file Site.php.
Referenced by MediaWiki\Site\Site\getSource(), and MediaWiki\Site\Site\setSource().
|
protected |
Definition at line 70 of file Site.php.
Referenced by MediaWiki\Site\MediaWikiSite\__construct(), MediaWiki\Site\Site\__construct(), and MediaWiki\Site\Site\getType().
const MediaWiki\Site\Site::GROUP_NONE = 'none' |
Definition at line 40 of file Site.php.
Referenced by MediaWiki\Site\SiteImporter\makeSite().
const MediaWiki\Site\Site::SOURCE_LOCAL = 'local' |
Definition at line 45 of file Site.php.
Referenced by MediaWiki\Site\SiteImporter\makeSite().
const MediaWiki\Site\Site::TYPE_UNKNOWN = 'unknown' |
Definition at line 37 of file Site.php.
Referenced by MediaWiki\Site\SiteImporter\makeSite().