MediaWiki
REL1_24
|
A codec for MediaWiki page titles. More...
Public Member Functions | |
__construct (Language $language, GenderCache $genderCache, $localInterwikis=array()) | |
formatTitle ($namespace, $text, $fragment= '') | |
getFullText (TitleValue $title) | |
getNamespaceName ($namespace, $text) | |
getPrefixedText (TitleValue $title) | |
getText (TitleValue $title) | |
parseTitle ($text, $defaultNamespace) | |
Parses the given text and constructs a TitleValue. | |
splitTitleString ($text, $defaultNamespace=NS_MAIN) | |
Normalizes and splits a title string. | |
Protected Attributes | |
GenderCache | $genderCache |
Language | $language |
string[] | $localInterwikis |
A codec for MediaWiki page titles.
Definition at line 35 of file MediaWikiTitleCodec.php.
MediaWikiTitleCodec::__construct | ( | Language $ | language, |
GenderCache $ | genderCache, | ||
$ | localInterwikis = array() |
||
) |
Language | $language | The language object to use for localizing namespace names. |
GenderCache | $genderCache | The gender cache for generating gendered namespace names |
string[]|string | $localInterwikis |
Definition at line 53 of file MediaWikiTitleCodec.php.
MediaWikiTitleCodec::formatTitle | ( | $ | namespace, |
$ | text, | ||
$ | fragment = '' |
||
) |
int | bool | $namespace | The namespace ID (or false, if the namespace should be ignored) |
string | $text | The page title. Should be valid. Only minimal normalization is applied. Underscores will be replaced. |
string | $fragment | The fragment name (may be empty). |
InvalidArgumentException | If the namespace is invalid |
Implements TitleFormatter.
Definition at line 100 of file MediaWikiTitleCodec.php.
MediaWikiTitleCodec::getFullText | ( | TitleValue $ | title | ) |
TitleValue | $title |
Implements TitleFormatter.
Definition at line 176 of file MediaWikiTitleCodec.php.
MediaWikiTitleCodec::getNamespaceName | ( | $ | namespace, |
$ | text | ||
) |
int | $namespace | |
string | $text |
InvalidArgumentException | If the namespace is invalid |
Implements TitleFormatter.
Definition at line 70 of file MediaWikiTitleCodec.php.
MediaWikiTitleCodec::getPrefixedText | ( | TitleValue $ | title | ) |
TitleValue | $title |
Implements TitleFormatter.
Definition at line 165 of file MediaWikiTitleCodec.php.
MediaWikiTitleCodec::getText | ( | TitleValue $ | title | ) |
TitleValue | $title |
Implements TitleFormatter.
Definition at line 154 of file MediaWikiTitleCodec.php.
MediaWikiTitleCodec::parseTitle | ( | $ | text, |
$ | defaultNamespace | ||
) |
Parses the given text and constructs a TitleValue.
Normalization is applied according to the rules appropriate for the form specified by $form.
string | $text | The text to parse |
int | $defaultNamespace | Namespace to assume per default (usually NS_MAIN) |
MalformedTitleException |
Implements TitleParser.
Definition at line 128 of file MediaWikiTitleCodec.php.
MediaWikiTitleCodec::splitTitleString | ( | $ | text, |
$ | defaultNamespace = NS_MAIN |
||
) |
Normalizes and splits a title string.
This function removes illegal characters, splits off the interwiki and namespace prefixes, sets the other forms, and canonicalizes everything.
string | $text | |
int | $defaultNamespace |
MalformedTitleException | If $text is not a valid title string. |
Definition at line 200 of file MediaWikiTitleCodec.php.
GenderCache MediaWikiTitleCodec::$genderCache [protected] |
Definition at line 42 of file MediaWikiTitleCodec.php.
Definition at line 38 of file MediaWikiTitleCodec.php.
string [] MediaWikiTitleCodec::$localInterwikis [protected] |
Definition at line 46 of file MediaWikiTitleCodec.php.