MediaWiki
1.23.2
|
Public Member Functions | |
__construct ( $type=self::TYPE_UNKNOWN) | |
Constructor. More... | |
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 type 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) | |
Returns $pageName without changes. 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 type 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 | SERIAL_VERSION_ID = '2013-01-23' |
const | SOURCE_LOCAL = 'local' |
const | TYPE_MEDIAWIKI = 'mediawiki' |
const | TYPE_UNKNOWN = 'unknown' |
Protected Attributes | |
array | $extraConfig = array() |
array | $extraData = array() |
bool | $forward = false |
string null | $globalId = null |
string | $group = self::GROUP_NONE |
int null | $internalId = null |
string null | $languageCode = null |
array[] | $localIds = array() |
Holds the local ids for this site. More... | |
string | $source = self::SOURCE_LOCAL |
string | $type = self::TYPE_UNKNOWN |
Site::__construct | ( | $type = self::TYPE_UNKNOWN | ) |
Constructor.
string | $type |
Reimplemented in MediaWikiSite.
Definition at line 122 of file Site.php.
Referenced by unserialize().
Site::addInterwikiId | ( | $identifier | ) |
Adds an interwiki id to the site.
string | $identifier |
Definition at line 511 of file Site.php.
References addLocalId().
Referenced by SiteTest\testAddInterwikiId().
Site::addLocalId | ( | $type, | |
$identifier | |||
) |
Adds a local identifier.
string | $type | |
string | $identifier |
Definition at line 490 of file Site.php.
References $type, and array().
Referenced by addInterwikiId(), and addNavigationId().
Site::addNavigationId | ( | $identifier | ) |
Adds a navigation id to the site.
string | $identifier |
Definition at line 522 of file Site.php.
References addLocalId().
Referenced by SiteTest\testAddNavigationId().
Site::getAllPaths | ( | ) |
Returns the paths as associative array.
The keys are path types, the values are the path urls.
Definition at line 605 of file Site.php.
References array().
Referenced by getPath(), SiteTest\testGetAllPaths(), and SiteTest\testSetAndRemovePath().
Site::getDomain | ( | ) |
Returns the domain of the site, ie en.wikipedia.org Or false if it's not known.
Definition at line 259 of file Site.php.
References $path, and getLinkPath().
Referenced by SiteSQLStore\getRowFromSite().
Site::getExtraConfig | ( | ) |
Returns the type specific config.
Definition at line 421 of file Site.php.
References $extraConfig.
Referenced by SiteSQLStore\getRowFromSite().
Site::getExtraData | ( | ) |
Returns the type specific fields.
Definition at line 399 of file Site.php.
References $extraData.
Referenced by SiteSQLStore\getRowFromSite().
Site::getGlobalId | ( | ) |
Returns the global site identifier (ie enwiktionary).
Definition at line 133 of file Site.php.
References $globalId.
Referenced by SiteSQLStore\getRowFromSite(), SiteTest\testGetGlobalId(), and SiteTest\testSetGlobalId().
Site::getGroup | ( | ) |
Gets the type of the site (ie wikipedia).
Definition at line 172 of file Site.php.
References $group.
Referenced by SiteSQLStore\getRowFromSite().
Site::getInternalId | ( | ) |
Returns the set internal identifier for the site.
Definition at line 466 of file Site.php.
References $internalId.
Referenced by SiteSQLStore\getRowFromSite().
Site::getInterwikiIds | ( | ) |
Returns the interwiki link identifiers that can be used for this site.
Definition at line 533 of file Site.php.
References array(), and ID_INTERWIKI.
Referenced by SiteTest\testAddInterwikiId(), and SiteTest\testGetInterwikiIds().
Site::getLanguageCode | ( | ) |
Returns language code of the sites primary language.
Or null if it's not known.
Definition at line 444 of file Site.php.
References $languageCode.
Referenced by SiteSQLStore\getRowFromSite(), SiteTest\testGetLanguageCode(), and SiteTest\testSetLanguageCode().
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 327 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 343 of file Site.php.
References PATH_LINK.
Referenced by getLinkPath(), and setLinkPath().
Site::getLocalIds | ( | ) |
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 545 of file Site.php.
References array(), and ID_EQUIVALENT.
Referenced by SiteTest\testAddNavigationId(), and SiteTest\testGetNavigationIds().
Site::getPageUrl | ( | $pageName = false | ) |
Returns the full URL for the given page on the site.
Or false 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 362 of file Site.php.
References getLinkPath().
Site::getPath | ( | $pathType | ) |
Returns the path of the provided type or false if there is no such path.
string | $pathType |
Definition at line 592 of file Site.php.
References getAllPaths().
Referenced by MediaWikiSite\getFileUrl(), getLinkPath(), MediaWikiSite\getRelativeFilePath(), MediaWikiSite\getRelativePagePath(), SiteTest\testGetPath(), and SiteTest\testSetAndRemovePath().
Site::getProtocol | ( | ) |
Returns the protocol of the site.
MWException |
Definition at line 277 of file Site.php.
References $path, and getLinkPath().
Referenced by SiteSQLStore\getRowFromSite().
Site::getSource | ( | ) |
Returns the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').
Definition at line 200 of file Site.php.
References $source.
Referenced by SiteSQLStore\getRowFromSite().
Site::getType | ( | ) |
Returns the type of the site (ie mediawiki).
Definition at line 161 of file Site.php.
References $type.
Referenced by SiteSQLStore\getRowFromSite(), and SiteTest\testGetType().
|
static |
string | $siteType |
Definition at line 629 of file Site.php.
References global.
Referenced by SiteSQLStore\siteFromRow().
Site::normalizePageName | ( | $pageName | ) |
Returns $pageName without changes.
Subclasses may override this to apply some kind of normalization.
string | $pageName |
Reimplemented in MediaWikiSite.
Definition at line 388 of file Site.php.
Referenced by SiteTest\testNormalizePageName().
Site::removePath | ( | $pathType | ) |
Removes the path of the provided type if it's set.
string | $pathType |
Definition at line 616 of file Site.php.
Referenced by SiteTest\testSetAndRemovePath().
Site::serialize | ( | ) |
Site::setExtraConfig | ( | array | $extraConfig | ) |
Sets the type specific config.
array | $extraConfig |
Definition at line 432 of file Site.php.
References $extraConfig.
Referenced by unserialize().
Site::setExtraData | ( | array | $extraData | ) |
Sets the type specific fields.
array | $extraData |
Definition at line 410 of file Site.php.
References $extraData.
Referenced by unserialize().
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.
boolean | $shouldForward |
MWException |
Definition at line 243 of file Site.php.
Referenced by unserialize().
Site::setGlobalId | ( | $globalId | ) |
Sets the global site identifier (ie enwiktionary).
string | null | $globalId |
MWException |
Definition at line 146 of file Site.php.
References $globalId.
Referenced by SiteTest\testSetGlobalId(), and unserialize().
Site::setGroup | ( | $group | ) |
Sets the type of the site (ie wikipedia).
string | $group |
MWException |
Definition at line 185 of file Site.php.
References $group.
Referenced by unserialize().
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 478 of file Site.php.
References $internalId.
Referenced by unserialize().
Site::setLanguageCode | ( | $languageCode | ) |
Sets language code of the sites primary language.
string | $languageCode |
Definition at line 455 of file Site.php.
References $languageCode.
Referenced by SiteTest\testSetLanguageCode(), and unserialize().
Site::setLinkPath | ( | $fullUrl | ) |
Sets the path used to construct links with.
Shall be equivalent to setPath( getLinkPathType(), $fullUrl ).
string | $fullUrl |
MWException |
Definition at line 310 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 571 of file Site.php.
References array().
Referenced by MediaWikiSite\setFilePath(), setLinkPath(), MediaWikiSite\setPagePath(), and SiteTest\testSetAndRemovePath().
Site::setSource | ( | $source | ) |
Sets the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').
string | $source |
MWException |
Definition at line 213 of file Site.php.
References $source, and source.
Referenced by unserialize().
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 229 of file Site.php.
References $forward.
Referenced by SiteSQLStore\getRowFromSite().
Site::unserialize | ( | $serialized | ) |
string | $serialized |
Definition at line 671 of file Site.php.
References $serialized, __construct(), setExtraConfig(), setExtraData(), setForward(), setGlobalId(), setGroup(), setInternalId(), setLanguageCode(), and setSource().
Definition at line 101 of file Site.php.
Referenced by getExtraConfig(), and setExtraConfig().
|
protected |
|
protected |
Definition at line 56 of file Site.php.
Referenced by getGlobalId(), MediaWikiSite\newFromGlobalId(), and setGlobalId().
|
protected |
|
protected |
Definition at line 113 of file Site.php.
Referenced by getInternalId(), and setInternalId().
|
protected |
Definition at line 80 of file Site.php.
Referenced by getLanguageCode(), and setLanguageCode().
Holds the local ids for this site.
local id type => [ ids for this type (strings) ]
Definition at line 89 of file Site.php.
Referenced by getLocalIds().
|
protected |
|
protected |
Definition at line 62 of file Site.php.
Referenced by MediaWikiSite\__construct(), __construct(), addLocalId(), getLinkPath(), getType(), and setLinkPath().
const Site::GROUP_NONE = 'none' |
Definition at line 34 of file Site.php.
Referenced by SiteSQLStore\newSitesTable().
const Site::ID_EQUIVALENT = 'equivalent' |
Definition at line 37 of file Site.php.
Referenced by getNavigationIds().
const Site::ID_INTERWIKI = 'interwiki' |
Definition at line 36 of file Site.php.
Referenced by getInterwikiIds().
const Site::PATH_LINK = 'link' |
Definition at line 41 of file Site.php.
Referenced by getLinkPathType().
const Site::SERIAL_VERSION_ID = '2013-01-23' |
Definition at line 50 of file Site.php.
Referenced by SiteList\getSerialVersionId().
const Site::SOURCE_LOCAL = 'local' |
Definition at line 39 of file Site.php.
Referenced by SiteSQLStore\newSitesTable().
const Site::TYPE_UNKNOWN = 'unknown' |
Definition at line 31 of file Site.php.
Referenced by SiteSQLStore\newSitesTable(), and SiteSQLStore\siteFromRow().