MediaWiki REL1_35
|
Message subclass that prepends wikitext for API help. More...
Public Member Functions | |
__construct ( $paramValue, $text, $params=[], $deprecated=false, $internal=false) | |
fetchMessage () | |
Fetch the message. | |
getParamValue () | |
Fetch the parameter value. | |
isDeprecated () | |
Fetch the 'deprecated' flag. | |
isInternal () | |
Fetch the 'internal' flag. | |
Public Member Functions inherited from Message | |
__construct ( $key, $params=[], Language $language=null) | |
Stable to call. | |
__serialize () | |
__toString () | |
Magic method implementation of the above (for PHP >= 5.2.0), so we can do, eg: $foo = new Message( $key ); $string = "<abbr>$foo</abbr>";. | |
__unserialize ( $data) | |
bitrateParams (... $params) | |
Add parameters that are bitrates and will be passed through Language::formatBitrate before substitution. | |
content () | |
Returns the message as a Content object. | |
durationParams (... $params) | |
Add parameters that are durations of time and will be passed through Language::formatDuration before substitution. | |
escaped () | |
Returns the message text. | |
exists () | |
Check whether a message key has been defined currently. | |
expiryParams (... $params) | |
Add parameters that are expiration times and will be passed through Language::formatExpiry before substitution. | |
getFormat () | |
Returns the message format. | |
getKey () | |
Returns the message key. | |
getKeysToTry () | |
getLanguage () | |
Returns the Language of the Message. | |
getParams () | |
Returns the message parameters. | |
getTitle () | |
Get a title object for a mediawiki message, where it can be found in the mediawiki namespace. | |
inContentLanguage () | |
Request the message in the wiki's content language, unless it is disabled for this message. | |
inLanguage ( $lang) | |
Request the message in any language that is supported. | |
isBlank () | |
Check whether a message does not exist, or is an empty string. | |
isDisabled () | |
Check whether a message does not exist, is an empty string, or is "-". | |
isMultiKey () | |
numParams (... $params) | |
Add parameters that are numeric and will be passed through Language::formatNum before substitution. | |
params (... $args) | |
Adds parameters to the parameter list of this message. | |
parse () | |
Fully parse the text from wikitext to HTML. | |
parseAsBlock () | |
Returns the parsed message text which is always surrounded by a block element. | |
plain () | |
Returns the message text as-is, only parameters are substituted. | |
plaintextParams (... $params) | |
Add parameters that are plaintext and will be passed through without the content being evaluated. | |
rawParams (... $params) | |
Add parameters that are substituted after parsing or escaping. | |
serialize () | |
setContext (IContextSource $context) | |
Set the language and the title from a context object. | |
setInterfaceMessageFlag ( $interface) | |
Allows manipulating the interface message flag directly. | |
sizeParams (... $params) | |
Add parameters that are file sizes and will be passed through Language::formatSize before substitution. | |
text () | |
Returns the message text. | |
timeperiodParams (... $params) | |
Add parameters that are time periods and will be passed through Language::formatTimePeriod before substitution. | |
title ( $title) | |
Set the Title object to use as context when transforming the message. | |
toString ( $format=null) | |
Returns the message parsed from wikitext to HTML. | |
unserialize ( $serialized) | |
useDatabase ( $useDatabase) | |
Enable or disable database use. | |
Protected Attributes | |
$deprecated | |
$internal | |
$paramValue | |
Protected Attributes inherited from Message | |
Content | $content = null |
Content object representing the message. | |
string | $format = 'parse' |
bool | $interface = true |
In which language to get this message. | |
string | $key |
The message key. | |
string[] | $keysToTry |
List of keys to try when fetching the message. | |
Language bool | $language = false |
In which language to get this message. | |
string | $message |
array | $parameters = [] |
List of parameters which will be substituted into the message. | |
Title | $title = null |
Title object to use as context. | |
bool | $useDatabase = true |
Whether database can be used. | |
Private Member Functions | |
subMessage ( $key) | |
Additional Inherited Members | |
Static Public Member Functions inherited from Message | |
static | bitrateParam ( $bitrate) |
static | durationParam ( $duration) |
static | expiryParam ( $expiry) |
static | listParam (array $list, $type='text') |
static | newFallbackSequence (... $keys) |
Factory function accepting multiple message keys and returning a message instance for the first message which is non-empty. | |
static | newFromKey ( $key,... $params) |
Factory function that is just wrapper for the real constructor. | |
static | newFromSpecifier ( $value) |
Transform a MessageSpecifier or a primitive value used interchangeably with specifiers (a message key string, or a key + params array) into a proper Message. | |
static | numParam ( $num) |
static | plaintextParam ( $plaintext) |
static | rawParam ( $raw) |
static | sizeParam ( $size) |
static | timeperiodParam ( $period) |
Public Attributes inherited from Message | |
const | FORMAT_BLOCK_PARSE = 'block-parse' |
Use normal wikitext -> HTML parsing (the result will be wrapped in a block-level HTML tag) | |
const | FORMAT_ESCAPED = 'escaped' |
Transform {{..}} constructs, HTML-escape the result. | |
const | FORMAT_PARSE = 'parse' |
Use normal wikitext -> HTML parsing but strip the block-level wrapper. | |
const | FORMAT_PLAIN = 'plain' |
Use message text as-is. | |
const | FORMAT_TEXT = 'text' |
Transform {{..}} constructs but don't transform to HTML. | |
Protected Member Functions inherited from Message | |
extractParam ( $param, $format) | |
Extracts the parameter type and preprocessed the value if needed. | |
formatListParam (array $params, $listType, $format) | |
Formats a list of parameters as a concatenated string. | |
formatPlaintext ( $plaintext, $format) | |
Formats a message parameter wrapped with 'plaintext'. | |
parseText ( $string) | |
Wrapper for what ever method we use to parse wikitext. | |
replaceParameters ( $message, $type, $format) | |
Substitutes any parameters into the message text. | |
transformText ( $string) | |
Wrapper for what ever method we use to {{-transform wikitext. | |
Static Protected Attributes inherited from Message | |
static array | $listTypeMap |
Mapping from Message::listParam() types to Language methods. | |
Message subclass that prepends wikitext for API help.
This exists so the apihelp-*-paramvalue-*-* messages don't all have to include markup wikitext while still keeping the 'APIGetParamDescriptionMessages' hook simple.
@newable
Definition at line 34 of file ApiHelpParamValueMessage.php.
ApiHelpParamValueMessage::__construct | ( | $paramValue, | |
$text, | |||
$params = [] , |
|||
$deprecated = false , |
|||
$internal = false |
|||
) |
string | $paramValue | Parameter value being documented |
string | $text | Message to use. |
array | $params | Parameters for the message. |
bool | $deprecated | Whether the value is deprecated |
bool | $internal | Whether the value is internal |
InvalidArgumentException |
$deprecated
parameter $internal
parameter Definition at line 53 of file ApiHelpParamValueMessage.php.
References $deprecated, $internal, and $paramValue.
ApiHelpParamValueMessage::fetchMessage | ( | ) |
Fetch the message.
Reimplemented from Message.
Definition at line 96 of file ApiHelpParamValueMessage.php.
References Message\$message, isDeprecated(), isInternal(), and subMessage().
ApiHelpParamValueMessage::getParamValue | ( | ) |
Fetch the parameter value.
Definition at line 70 of file ApiHelpParamValueMessage.php.
References $paramValue.
ApiHelpParamValueMessage::isDeprecated | ( | ) |
Fetch the 'deprecated' flag.
Definition at line 79 of file ApiHelpParamValueMessage.php.
References $deprecated.
Referenced by fetchMessage().
ApiHelpParamValueMessage::isInternal | ( | ) |
Fetch the 'internal' flag.
Definition at line 88 of file ApiHelpParamValueMessage.php.
References $internal.
Referenced by fetchMessage().
|
private |
Definition at line 117 of file ApiHelpParamValueMessage.php.
References Message\$interface, Message\$key, Message\$language, Message\$title, and Message\$useDatabase.
Referenced by fetchMessage().
|
protected |
Definition at line 37 of file ApiHelpParamValueMessage.php.
Referenced by __construct(), and isDeprecated().
|
protected |
Definition at line 38 of file ApiHelpParamValueMessage.php.
Referenced by __construct(), and isInternal().
|
protected |
Definition at line 36 of file ApiHelpParamValueMessage.php.
Referenced by __construct(), and getParamValue().