|
MediaWiki master
|
Class representing a MediaWiki site. More...
Inherits MediaWiki\Site\Site.

Public Member Functions | |
| __construct ( $type=self::TYPE_MEDIAWIKI) | |
| getFileUrl ( $path=false) | |
| Get the full URL to an entry point under a wiki's script path. | |
| getLinkPathType () | |
| Get the constant for getting or setting the script path. | |
| getPageUrl ( $pageName=false) | |
| Get the full URL for the given page on the site. | |
| getRelativeFilePath () | |
| Get the script script, as relative path only (without server). | |
| getRelativePagePath () | |
| Get the article path, as relative path only (without server). | |
| normalizePageName ( $pageName, $followRedirect=MediaWikiPageNameNormalizer::FOLLOW_REDIRECT) | |
| Get the normalized form of the given page title. | |
| setFilePath ( $path) | |
| Set the script path. | |
| setPagePath ( $path) | |
| Set the article path. | |
| toDBKey ( $title) | |
| Get the database form of the given title. | |
Public Member Functions inherited from MediaWiki\Site\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 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). | |
| 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. | |
Public Attributes | |
| const | PATH_FILE = 'file_path' |
| The script path of a site, e.g. | |
| const | PATH_PAGE = 'page_path' |
| The article path of a site, e.g. | |
Public Attributes inherited from MediaWiki\Site\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 MediaWiki\Site\Site | |
| static | newForType ( $siteType) |
Protected Attributes inherited from MediaWiki\Site\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 |
| string[][] false | $localIds = [] |
| Holds the local ids for this site. | |
| string | $source = self::SOURCE_LOCAL |
| string | $type = self::TYPE_UNKNOWN |
| MediaWiki\Site\MediaWikiSite::__construct | ( | $type = self::TYPE_MEDIAWIKI | ) |
| string | $type |
Reimplemented from MediaWiki\Site\Site.
Definition at line 31 of file MediaWikiSite.php.
References MediaWiki\Site\Site\$type.
| MediaWiki\Site\MediaWikiSite::getFileUrl | ( | $path = false | ) |
Get the full URL to an entry point under a wiki's script path.
This is the equivalent of wfScript() for other sites.
The path should go at the $1 marker. If the $path argument is provided, the marker will be replaced by its value.
| string | false | $path | Not passing a string for this is deprecated since 1.40. |
Definition at line 186 of file MediaWikiSite.php.
References $path, MediaWiki\Site\Site\getPath(), and wfDeprecatedMsg().
Referenced by MediaWiki\Site\MediaWikiSite\normalizePageName().
| MediaWiki\Site\MediaWikiSite::getLinkPathType | ( | ) |
Get the constant for getting or setting the script path.
This configures how Site::setLinkPath() and Site::getLinkPath() will work internally in terms of Site::setPath() and Site::getPath().
Reimplemented from MediaWiki\Site\Site.
Definition at line 102 of file MediaWikiSite.php.
References MediaWiki\Site\MediaWikiSite\PATH_PAGE.
| MediaWiki\Site\MediaWikiSite::getPageUrl | ( | $pageName = false | ) |
Get the full URL for the given page on the site.
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 | false | $pageName | Page name or false (default: false) |
Reimplemented from MediaWiki\Site\Site.
Definition at line 159 of file MediaWikiSite.php.
References $url, MediaWiki\Site\Site\getLinkPath(), MediaWiki\Site\MediaWikiSite\toDBKey(), and wfUrlencode().
| MediaWiki\Site\MediaWikiSite::getRelativeFilePath | ( | ) |
Get the script script, as relative path only (without server).
Definition at line 122 of file MediaWikiSite.php.
References MediaWiki\Site\Site\getPath().
| MediaWiki\Site\MediaWikiSite::getRelativePagePath | ( | ) |
Get the article path, as relative path only (without server).
Definition at line 112 of file MediaWikiSite.php.
References MediaWiki\Site\Site\getPath().
| MediaWiki\Site\MediaWikiSite::normalizePageName | ( | $pageName, | |
| $followRedirect = MediaWikiPageNameNormalizer::FOLLOW_REDIRECT ) |
Get the normalized form of the given page title.
This uses to normalization rules of the given site. If $followRedirect is set to true and 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 | |
| int | $followRedirect | either MediaWikiPageNameNormalizer::FOLLOW_REDIRECT or MediaWikiPageNameNormalizer::NOFOLLOW_REDIRECT |
Reimplemented from MediaWiki\Site\Site.
Definition at line 71 of file MediaWikiSite.php.
References MediaWiki\Site\MediaWikiSite\getFileUrl().
| MediaWiki\Site\MediaWikiSite::setFilePath | ( | $path | ) |
Set the script path.
| string | $path |
Definition at line 142 of file MediaWikiSite.php.
References $path, and MediaWiki\Site\Site\setPath().
| MediaWiki\Site\MediaWikiSite::setPagePath | ( | $path | ) |
Set the article path.
| string | $path |
Definition at line 132 of file MediaWikiSite.php.
References $path, and MediaWiki\Site\Site\setPath().
| MediaWiki\Site\MediaWikiSite::toDBKey | ( | $title | ) |
Get the database form of the given title.
| string | $title | The target page's title, in normalized form. |
Definition at line 42 of file MediaWikiSite.php.
Referenced by MediaWiki\Site\MediaWikiSite\getPageUrl().
| const MediaWiki\Site\MediaWikiSite::PATH_FILE = 'file_path' |
The script path of a site, e.g.
/w/$1 related to $wgScriptPath
Definition at line 23 of file MediaWikiSite.php.
| const MediaWiki\Site\MediaWikiSite::PATH_PAGE = 'page_path' |
The article path of a site, e.g.
/wiki/$1 like $wgArticlePath
Definition at line 25 of file MediaWikiSite.php.
Referenced by MediaWiki\Site\MediaWikiSite\getLinkPathType().