|
const | TYPE_UNKNOWN = 'unknown' |
|
const | TYPE_MEDIAWIKI = 'mediawiki' |
|
const | GROUP_NONE = 'none' |
|
const | ID_INTERWIKI = 'interwiki' |
|
const | ID_EQUIVALENT = 'equivalent' |
|
const | SOURCE_LOCAL = 'local' |
|
const | PATH_LINK = 'link' |
|
const | SERIAL_VERSION_ID = '2013-01-23' |
|
|
| $globalId = null |
|
| $type = self::TYPE_UNKNOWN |
|
| $group = self::GROUP_NONE |
|
| $source = self::SOURCE_LOCAL |
|
| $languageCode = null |
|
| $localIds = [] |
|
| $extraData = [] |
|
| $extraConfig = [] |
|
| $forward = false |
|
| $internalId = null |
|
Site::__construct |
( |
|
$type = self::TYPE_UNKNOWN | ) |
|
Site::addInterwikiId |
( |
|
$identifier | ) |
|
Adds an interwiki id to the site.
- Since
- 1.21
- Parameters
-
Site::addLocalId |
( |
|
$type, |
|
|
|
$identifier |
|
) |
| |
Adds a local identifier.
- Since
- 1.21
- Parameters
-
string | $type | |
string | $identifier | |
Site::addNavigationId |
( |
|
$identifier | ) |
|
Adds a navigation id to the site.
- Since
- 1.21
- Parameters
-
Returns the paths as associative array. The keys are path types, the values are the path urls.
- Since
- 1.21
- Returns
- string[]
Returns the domain of the site, ie en.wikipedia.org Or false if it's not known.
- Since
- 1.21
- Returns
- string|null
Returns the type specific config.
- Since
- 1.21
- Returns
- array
Returns the type specific fields.
- Since
- 1.21
- Returns
- array
Returns the global site identifier (ie enwiktionary).
- Since
- 1.21
- Returns
- string|null
Gets the group of the site (ie wikipedia).
- Since
- 1.21
- Returns
- string
Returns the set internal identifier for the site.
- Since
- 1.21
- Returns
- string|null
Site::getInterwikiIds |
( |
| ) |
|
Returns the interwiki link identifiers that can be used for this site.
- Since
- 1.21
- Returns
- string[]
Site::getLanguageCode |
( |
| ) |
|
Returns language code of the sites primary language. Or null if it's not known.
- Since
- 1.21
- Returns
- string|null
Returns the path used to construct links with or false if there is no such path.
Shall be equivalent to getPath( getLinkPathType() ).
- Returns
- string|null
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.
- Since
- 1.21
- Returns
- string|null
Returns all local ids
- Since
- 1.21
- Returns
- array[]
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.
- Since
- 1.21
- Returns
- string[]
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().
- Since
- 1.21
- Parameters
-
- Returns
- string|bool
Site::getPath |
( |
|
$pathType | ) |
|
Returns the path of the provided type or false if there is no such path.
- Since
- 1.21
- Parameters
-
- Returns
- string|null
Returns the protocol of the site.
- Since
- 1.21
- Exceptions
-
- Returns
- string
Returns the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').
- Since
- 1.21
- Returns
- string
Returns the type of the site (ie mediawiki).
- Since
- 1.21
- Returns
- string
static Site::newForType |
( |
|
$siteType | ) |
|
|
static |
- Since
- 1.21
- Parameters
-
- Returns
- Site
Site::normalizePageName |
( |
|
$pageName | ) |
|
Attempt to normalize the page name in some fashion. May return false to indicate various kinds of failure.
This implementation returns $pageName without changes.
- See Also
- Site::normalizePageName
- Since
- 1.21
- Parameters
-
- Returns
- string|false
Site::removePath |
( |
|
$pathType | ) |
|
Removes the path of the provided type if it's set.
- Since
- 1.21
- Parameters
-
Site::setExtraConfig |
( |
array |
$extraConfig | ) |
|
Sets the type specific config.
- Since
- 1.21
- Parameters
-
Site::setExtraData |
( |
array |
$extraData | ) |
|
Sets the type specific fields.
- Since
- 1.21
- Parameters
-
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.
- Since
- 1.21
- Parameters
-
- Exceptions
-
Site::setGlobalId |
( |
|
$globalId | ) |
|
Sets the global site identifier (ie enwiktionary).
- Since
- 1.21
- Parameters
-
- Exceptions
-
Sets the group of the site (ie wikipedia).
- Since
- 1.21
- Parameters
-
- Exceptions
-
Site::setInternalId |
( |
|
$internalId = null | ) |
|
Sets the internal identifier for the site. This typically is a primary key in a db table.
- Since
- 1.21
- Parameters
-
Site::setLanguageCode |
( |
|
$languageCode | ) |
|
Sets language code of the sites primary language.
- Since
- 1.21
- Parameters
-
Site::setLinkPath |
( |
|
$fullUrl | ) |
|
Sets the path used to construct links with. Shall be equivalent to setPath( getLinkPathType(), $fullUrl ).
- Parameters
-
- Since
- 1.21
- Exceptions
-
Site::setPath |
( |
|
$pathType, |
|
|
|
$fullUrl |
|
) |
| |
Sets the path used to construct links with. Shall be equivalent to setPath( getLinkPathType(), $fullUrl ).
- Since
- 1.21
- Parameters
-
string | $pathType | |
string | $fullUrl | |
- Exceptions
-
Site::setSource |
( |
|
$source | ) |
|
Sets the source of the site data (ie 'local', 'wikidata', 'my-magical-repo').
- Since
- 1.21
- Parameters
-
- Exceptions
-
Gets if site.tld/path/key:pageTitle should forward users to the page on the actual site, where "key" is the local identifier.
- Since
- 1.21
- Returns
- bool
Site::unserialize |
( |
|
$serialized | ) |
|
The documentation for this class was generated from the following file:
- /home/hwfunc/workspace/leonid/BlueSpiceDoc-composer/mediawiki-master/includes/site/Site.php