MediaWiki fundraising/REL1_35
|
Class representing a MediaWiki site. More...
Public Member Functions | |
__construct ( $type=self::TYPE_MEDIAWIKI) | |
getFileUrl ( $path=false) | |
Returns the full file path (ie site url + relative file path). | |
getLinkPathType () | |
getPageUrl ( $pageName=false) | |
getRelativeFilePath () | |
Returns the relative file path. | |
getRelativePagePath () | |
Returns the relative page path. | |
normalizePageName ( $pageName) | |
Returns the normalized form of the given page title, using the normalization rules of the given site. | |
setFilePath ( $path) | |
Sets the relative file path. | |
setPagePath ( $path) | |
Sets the relative page path. | |
toDBKey ( $title) | |
Returns the database form of the given title. | |
Public Member Functions inherited from Site | |
__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. | |
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. | |
getPath ( $pathType) | |
Returns the path of the provided type or false 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). | |
removePath ( $pathType) | |
Removes the path of the provided type if it's set. | |
serialize () | |
setExtraConfig (array $extraConfig) | |
Sets the type specific config. | |
setExtraData (array $extraData) | |
Sets the type specific fields. | |
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. | |
setGlobalId ( $globalId) | |
Sets the global site identifier (ie enwiktionary). | |
setGroup ( $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) | |
Sets the path used to construct links with. | |
setPath ( $pathType, $fullUrl) | |
Sets the path used to construct links with. | |
setSource ( $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. | |
unserialize ( $serialized) | |
Public Attributes | |
const | PATH_FILE = 'file_path' |
const | PATH_PAGE = 'page_path' |
Public Attributes inherited from Site | |
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' |
Additional Inherited Members | |
Static Public Member Functions inherited from Site | |
static | newForType ( $siteType) |
Protected Attributes inherited from Site | |
array | $extraConfig = [] |
array | $extraData = [] |
bool | $forward = false |
string null | $globalId = null |
string | $group = self::GROUP_NONE |
int null | $internalId = null |
string null | $languageCode = null |
array[] false | $localIds = [] |
Holds the local ids for this site. | |
string | $source = self::SOURCE_LOCAL |
string | $type = self::TYPE_UNKNOWN |
MediaWikiSite::__construct | ( | $type = self::TYPE_MEDIAWIKI | ) |
string | $type |
Reimplemented from Site.
Definition at line 47 of file MediaWikiSite.php.
References $type.
MediaWikiSite::getFileUrl | ( | $path = false | ) |
Returns the full file path (ie site url + relative file path).
The path should go at the $1 marker. If the $path argument is provided, the marker will be replaced by it's value.
string | bool | $path |
Definition at line 207 of file MediaWikiSite.php.
References $path, and Site\getPath().
Referenced by normalizePageName().
MediaWikiSite::getLinkPathType | ( | ) |
Reimplemented from Site.
Definition at line 119 of file MediaWikiSite.php.
MediaWikiSite::getPageUrl | ( | $pageName = false | ) |
This implementation returns a URL constructed using the path returned by getLinkPath(). In addition to the default behavior implemented by Site::getPageUrl(), this method converts the $pageName to DBKey-format by replacing spaces with underscores before using it in the URL.
string | bool | $pageName | Page name or false (default: false) |
Reimplemented from Site.
Definition at line 181 of file MediaWikiSite.php.
References Site\getLinkPath(), toDBKey(), and wfUrlencode().
MediaWikiSite::getRelativeFilePath | ( | ) |
Returns the relative file path.
Definition at line 141 of file MediaWikiSite.php.
References Site\getPath().
MediaWikiSite::getRelativePagePath | ( | ) |
Returns the relative page path.
Definition at line 130 of file MediaWikiSite.php.
References Site\getPath().
MediaWikiSite::normalizePageName | ( | $pageName | ) |
Returns the normalized form of the given page title, using the normalization rules of the given site.
If the given title is a redirect, the redirect will be resolved and the redirect target is returned. Only titles of existing pages will be returned.
string | $pageName |
MWException |
Reimplemented from Site.
Definition at line 88 of file MediaWikiSite.php.
References $t, and getFileUrl().
MediaWikiSite::setFilePath | ( | $path | ) |
Sets the relative file path.
string | $path |
Definition at line 163 of file MediaWikiSite.php.
References $path, and Site\setPath().
MediaWikiSite::setPagePath | ( | $path | ) |
Sets the relative page path.
string | $path |
Definition at line 152 of file MediaWikiSite.php.
References $path, and Site\setPath().
MediaWikiSite::toDBKey | ( | $title | ) |
Returns the database form of the given title.
string | $title | The target page's title, in normalized form. |
Definition at line 60 of file MediaWikiSite.php.
References $title.
Referenced by getPageUrl().
const MediaWikiSite::PATH_FILE = 'file_path' |
Definition at line 39 of file MediaWikiSite.php.
const MediaWikiSite::PATH_PAGE = 'page_path' |
Definition at line 40 of file MediaWikiSite.php.