Go to the documentation of this file.
27 use HtmlFormatter\HtmlFormatter;
51 $out->setCopyrightUrl(
'https://www.mediawiki.org/wiki/Special:MyLanguage/Copyright' );
59 $html = ob_get_clean();
64 'mime' =>
'text/html',
65 'filename' =>
'api-help.html',
105 $out->addModuleStyles( [
110 $out->addModules(
'mediawiki.toc' );
114 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
120 if ( $cacheHelpTimeout > 0 ) {
125 $cached =
$cache->get( $cacheKey );
127 $out->addHTML( $cached );
132 if (
$out->getHTML() !==
'' ) {
138 $options[
'recursivesubmodules'] = !empty(
$options[
'recursivesubmodules'] );
142 if ( empty(
$options[
'nolead'] ) ) {
144 if ( !$msg->isDisabled() ) {
145 $out->addHTML( $msg->parseAsBlock() );
151 if ( !empty(
$options[
'toc'] ) && $haveModules ) {
161 if ( $cacheKey !==
null ) {
162 $cache->set( $cacheKey,
$out->getHTML(), $cacheHelpTimeout );
175 $formatter =
new HtmlFormatter(
$html );
176 $doc = $formatter->getDoc();
177 $xpath =
new DOMXPath( $doc );
178 $nodes = $xpath->query(
'//a[@href][not(contains(@class,\'apihelp-linktrail\'))]' );
179 foreach ( $nodes
as $node ) {
180 $href = $node->getAttribute(
'href' );
183 $href = rawurldecode( $href );
184 }
while ( $old !== $href );
185 if ( preg_match(
'!Special:ApiHelp/([^&/|#]+)((?:#.*)?)!', $href, $m ) ) {
186 if ( isset( $localModules[$m[1]] ) ) {
187 $href = $m[2] ===
'' ?
'#' . $m[1] : $m[2];
188 } elseif ( $helptitle !==
null ) {
197 $node->setAttribute(
'href', $href );
198 $node->removeAttribute(
'title' );
202 return $formatter->getText();
213 private static function wrap( Message $msg, $class, $tag =
'span' ) {
234 if ( empty(
$options[
'tocnumber'] ) ) {
235 $tocnumber = [ 2 => 0 ];
237 $tocnumber = &
$options[
'tocnumber'];
241 $tocnumber[$level]++;
242 $path = $module->getModulePath();
257 while ( isset( $haveModules[$anchor] ) ) {
258 $anchor =
$path .
'|' . ++$i;
261 if ( $module->isMain() ) {
262 $headerContent =
$context->
msg(
'api-help-main-header' )->parse();
264 'class' =>
'apihelp-header',
267 $name = $module->getModuleName();
268 $headerContent = $module->getParent()->getModuleManager()->getModuleGroup(
$name ) .
270 if ( $module->getModulePrefix() !==
'' ) {
271 $headerContent .=
' ' .
272 $context->
msg(
'parentheses', $module->getModulePrefix() )->parse();
278 'class' =>
'apihelp-header apihelp-module-name',
284 $headerAttr[
'id'] = $anchor;
286 $haveModules[$anchor] = [
287 'toclevel' =>
count( $tocnumber ),
290 'line' => $headerContent,
291 'number' => implode(
'.', $tocnumber ),
294 if ( empty(
$options[
'noheader'] ) ) {
296 'h' . min( 6, $level ),
302 $haveModules[
$path] =
true;
307 for ( $m = $module; $m !==
null; $m = $m->getParent() ) {
308 $name = $m->getModuleName();
309 if (
$name ===
'main_int' ) {
314 !( !empty(
$options[
'submodules'] ) && $m->getModuleManager() )
320 [
'href' =>
$link,
'class' =>
'apihelp-linktrail',
'dir' =>
'ltr',
'lang' =>
'en' ],
325 array_unshift( $links,
$link );
331 'apihelp-linktrail',
'div'
335 $flags = $module->getHelpFlags();
337 [
'class' =>
'apihelp-block apihelp-flags' ] );
339 if ( !$msg->isDisabled() ) {
341 $msg->numParams(
count(
$flags ) ),
'apihelp-block-head',
'div'
347 self::wrap(
$context->
msg(
"api-help-flag-$flag" ),
"apihelp-flag-$flag" )
350 $sourceInfo = $module->getModuleSourceInfo();
352 if ( isset( $sourceInfo[
'namemsg'] ) ) {
353 $extname =
$context->
msg( $sourceInfo[
'namemsg'] )->text();
356 $extname =
Html::element(
'span', [
'dir' =>
'ltr',
'lang' =>
'en' ], $sourceInfo[
'name'] );
360 $context->
msg(
'api-help-source', $extname, $sourceInfo[
'name'] ),
366 if ( isset( $sourceInfo[
'license-name'] ) ) {
368 Html::element(
'span', [
'dir' =>
'ltr',
'lang' =>
'en' ], $sourceInfo[
'license-name'] )
373 $msg =
$context->
msg(
'api-help-license-unknown' );
376 self::wrap( $msg,
'apihelp-license' )
380 self::wrap(
$context->
msg(
'api-help-source-unknown' ),
'apihelp-source' )
383 self::wrap(
$context->
msg(
'api-help-license-unknown' ),
'apihelp-license' )
389 foreach ( $module->getFinalDescription()
as $msg ) {
391 $help[
'description'] .= $msg->parseAsBlock();
394 $urls = $module->getHelpUrls();
397 [
'class' =>
'apihelp-block apihelp-help-urls' ]
400 if ( !$msg->isDisabled() ) {
402 $msg->numParams(
count( $urls ) ),
'apihelp-block-head',
'div'
405 if ( !is_array( $urls ) ) {
409 foreach ( $urls
as $url ) {
411 Html::element(
'a', [
'href' => $url,
'dir' =>
'ltr' ], $url )
419 $dynamicParams = $module->dynamicParameterDocumentation();
421 if (
$params || $dynamicParams !==
null ) {
423 [
'class' =>
'apihelp-block apihelp-parameters' ]
426 if ( !$msg->isDisabled() ) {
428 $msg->numParams(
count(
$params ) ),
'apihelp-block-head',
'div'
433 $descriptions = $module->getFinalParamDescription();
436 if ( !is_array( $settings ) ) {
441 Html::element(
'span', [
'dir' =>
'ltr',
'lang' =>
'en' ], $module->encodeParamName(
$name ) )
446 if ( isset( $descriptions[
$name] ) ) {
447 foreach ( $descriptions[
$name]
as $msg ) {
449 $description[] = $msg->parseAsBlock();
458 $info[] =
$context->
msg(
'api-help-param-required' )->parse();
464 $tag = array_shift( $i );
465 $info[] =
$context->
msg(
"apihelp-{$path}-paraminfo-{$tag}" )
466 ->numParams(
count( $i ) )
468 ->params( $module->getModulePrefix() )
478 if ( is_bool( $dflt ) ) {
480 } elseif ( is_string( $dflt ) || is_null( $dflt ) ) {
482 } elseif ( is_int( $dflt ) ) {
489 $hintPipeSeparated =
true;
494 if ( is_array(
$type ) ) {
502 $values = array_map(
function ( $v )
use ( $links, $deprecatedValues ) {
506 $attr[
'dir'] =
'auto';
508 if ( isset( $deprecatedValues[$v] ) ) {
509 $attr[
'class'] =
'apihelp-deprecated-value';
512 if ( isset( $links[$v] ) ) {
513 $ret =
"[[{$links[$v]}|$ret]]";
517 $i = array_search(
'',
$type,
true );
518 if ( $i ===
false ) {
521 unset( $values[$i] );
522 $values =
$context->
msg(
'api-help-param-list-can-be-empty' )
523 ->numParams(
count( $values ) )
528 ->params( $multi ? 2 : 1 )
531 $hintPipeSeparated =
false;
541 $prefix = $module->isMain() ?
'' : ( $module->getModulePath() .
'+' );
543 foreach ( $module->getModuleManager()->getNames(
$name )
as $submoduleName ) {
544 $map[$submoduleName] = $prefix . $submoduleName;
546 $defaultAttrs = [
'dir' =>
'ltr',
'lang' =>
'en' ];
551 $deprecatedSubmodules = [];
552 foreach ( $map
as $v => $m ) {
553 $attrs = $defaultAttrs;
556 $submod = $module->getModuleFromPath( $m );
558 if ( $submod->isDeprecated() ) {
559 $arr = &$deprecatedSubmodules;
560 $attrs[
'class'] =
'apihelp-deprecated-value';
569 $arr[] =
"[[Special:ApiHelp/{$m}|{$v}]]";
571 $submodules = array_merge( $submodules, $deprecatedSubmodules );
572 $count =
count( $submodules );
574 ->params( $multi ? 2 : 1 )
577 $hintPipeSeparated =
false;
592 ->params( $multi ? 2 : 1 )
595 $hintPipeSeparated =
false;
602 $count =
count( $tags );
604 ->params( $multi ? 2 : 1 )
607 $hintPipeSeparated =
false;
639 if ( $suffix !==
'' ) {
642 ->params( $multi ? 2 : 1 )
643 ->numParams( $min, $max )
667 if ( is_string(
$type ) ) {
668 $msg =
$context->
msg(
"api-help-param-type-$type" );
669 if ( !$msg->isDisabled() ) {
670 $info[] = $msg->params( $multi ? 2 : 1 )->parse();
683 if ( $hintPipeSeparated ) {
684 $extra[] =
$context->
msg(
'api-help-param-multi-separate' )->parse();
686 if ( $count > $lowcount ) {
687 if ( $lowcount === $highcount ) {
688 $msg =
$context->
msg(
'api-help-param-multi-max-simple' )
689 ->numParams( $lowcount );
692 ->numParams( $lowcount, $highcount );
694 $extra[] = $msg->parse();
697 $info[] = implode(
' ', $extra );
709 $info[] =
$context->
msg(
'api-help-param-multi-all' )
710 ->params( $allSpecifier )
720 if ( $default ===
'' ) {
721 $info[] =
$context->
msg(
'api-help-param-default-empty' )
723 } elseif ( $default !==
null && $default !==
false ) {
725 $info[] =
$context->
msg(
'api-help-param-default' )
726 ->params(
Html::element(
'span', [
'dir' =>
'auto' ], $default ) )
730 if ( !array_filter( $description ) ) {
740 [
'class' =>
'info' ] );
743 'apihelp-deprecated',
'strong'
748 if ( $description ) {
749 $description = implode(
'', $description );
750 $description = preg_replace(
'!\s*</([oud]l)>\s*<\1>\s*!',
"\n", $description );
752 [
'class' =>
'description' ], $description );
755 foreach ( $info
as $i ) {
760 if ( $dynamicParams !==
null ) {
762 $module->getModulePrefix(),
763 $module->getModuleName(),
764 $module->getModulePath()
768 [
'class' =>
'description' ], $dynamicParams->parse() );
775 $examples = $module->getExamplesMessages();
778 [
'class' =>
'apihelp-block apihelp-examples' ] );
780 if ( !$msg->isDisabled() ) {
782 $msg->numParams(
count( $examples ) ),
'apihelp-block-head',
'div'
787 foreach ( $examples
as $qs => $msg ) {
789 $module->getModulePrefix(),
790 $module->getModuleName(),
791 $module->getModulePath()
800 $context->
msg(
'api-help-open-in-apisandbox' )->parse() )
807 $subtocnumber = $tocnumber;
808 $subtocnumber[$level + 1] = 0;
810 'submodules' =>
$options[
'recursivesubmodules'],
811 'headerlevel' => $level + 1,
812 'tocnumber' => &$subtocnumber,
816 if (
$options[
'submodules'] && $module->getModuleManager() ) {
817 $manager = $module->getModuleManager();
819 foreach ( $groups
as $group ) {
820 $names = $manager->getNames( $group );
823 $submodules[] = $manager->getModule(
$name );
834 $module->modifyHelp(
$help, $suboptions, $haveModules );
836 Hooks::run(
'APIHelpModifyOutput', [ $module, &
$help, $suboptions, &$haveModules ] );
859 $errorPrinter = $main->createPrinterByName( $main->getParameter(
'format' ) );
869 'submodules' =>
false,
870 'recursivesubmodules' =>
false,
879 =>
'apihelp-help-example-main',
880 'action=help&modules=query&submodules=1'
881 =>
'apihelp-help-example-submodules',
882 'action=help&recursivesubmodules=1'
883 =>
'apihelp-help-example-recursive',
884 'action=help&modules=help'
885 =>
'apihelp-help-example-help',
886 'action=help&modules=query+info|query+categorymembers'
887 =>
'apihelp-help-example-query',
893 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page',
894 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:FAQ',
895 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Quick_start_guide',
This is the main API class, used for both external and internal processing.
const PARAM_SUBMODULE_MAP
(string[]) When PARAM_TYPE is 'submodule', map parameter values to submodule paths.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Exception used to abort API execution with an error.
getContext()
Get the base IContextSource object.
static getValidNamespaces()
Returns an array of the namespaces (by integer id) that exist on the wiki.
const PARAM_REQUIRED
(boolean) Is the parameter required?
getExamplesMessages()
Returns usage examples for this module.
static wrap(Message $msg, $class, $tag='span')
Wrap a message in HTML with a class.
static generateTOC( $tree, $lang=false)
Generate a table of contents from a section tree.
const PARAM_ALL
(boolean|string) When PARAM_TYPE has a defined set of values and PARAM_ISMULTI is true,...
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetMagic':DEPRECATED! Use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language & $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetSpecialPageAliases':DEPRECATED! Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language & $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Array with elements of the form "language:title" in the order that they will be output. & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
namespace and then decline to actually register it & $namespaces
isReadMode()
Indicates whether this module requires read rights.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
static getHelpInternal(IContextSource $context, array $modules, array $options, &$haveModules)
Recursively-called function to actually construct the help.
getResult()
Get the result object.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
const PARAM_ISMULTI_LIMIT1
(integer) Maximum number of values, for normal users.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
static makeMessage( $msg, IContextSource $context, array $params=null)
Create a Message from a string or array.
const NO_SIZE_CHECK
For addValue() and similar functions, do not check size while adding a value Don't use this unless yo...
Allows to change the fields on the form that will be generated $name
const PARAM_DEPRECATED_VALUES
(array) When PARAM_TYPE is an array, this indicates which of the values are deprecated.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
This abstract class implements many basic API functions, and is the base of all API classes.
getModuleFromPath( $path)
Get a module from its module path.
getLanguage()
Get the Language object.
const PARAM_ISMULTI_LIMIT2
(integer) Maximum number of values, for users with the apihighimits right.
wfAppendQuery( $url, $query)
Append a query string to an existing URL, which may or may not already have query string parameters a...
static closeElement( $element)
Returns "</$element>".
const PARAM_DEPRECATED
(boolean) Is the parameter deprecated (will show a warning)?
const PARAM_MIN
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
An IContextSource implementation which will inherit context from another source but allow individual ...
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
getModulePath()
Get the path to this module.
const PARAM_MAX
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
getHelpUrls()
Return links to more detailed help pages about the module.
msg( $key)
This is the method for getting translated interface messages.
when a variable name is used in a it is silently declared as a new masking the global
const PARAM_EXTRA_NAMESPACES
(int[]) When PARAM_TYPE is 'namespace', include these as additional possible values.
This class should be covered by a general architecture document which does not exist as of January 20...
static getExtLicenseFileName( $extDir)
Obtains the full path of an extensions copying or license file if one exists.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
static getVersion( $flags='', $lang=null)
Return a string of the MediaWiki version with Git revision if available.
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
static fixHelpLinks( $html, $helptitle=null, $localModules=[])
Replace Special:ApiHelp links with links to api.php.
const LIMIT_SML2
Slow query, apihighlimits limit.
const GET_VALUES_FOR_HELP
getAllowedParams() flag: When set, the result could take longer to generate, but should be more thoro...
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
const PARAM_HELP_MSG_INFO
(array) Specify additional information tags for the parameter.
Interface for objects which can provide a MediaWiki context on request.
const PARAM_VALUE_LINKS
(string[]) When PARAM_TYPE is an array, this may be an array mapping those values to page titles whic...
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
static getHelp(IContextSource $context, $modules, array $options)
Generate help for the specified modules.
getConfig()
Get the site configuration.
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
getModuleName()
Get the name of the module being executed by this instance.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
shouldCheckMaxlag()
Indicates if this module needs maxlag to be checked.
usually copyright or history_copyright This message must be in HTML not wikitext & $link
const PARAM_MAX2
(integer) Max value allowed for the parameter for users with the apihighlimits right,...
getMain()
Get the main module.
getCustomPrinter()
If the module may only be used with a certain format module, it should override this method to return...
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
getOutput()
Get the OutputPage object.
static setSubelementsList(array &$arr, $names)
Causes the elements with the specified names to be output as subelements rather than attributes.
static getDefaultInstance()
it s the revision text itself In either if gzip is the revision text is gzipped $flags
getLanguage()
Get the Language object.
const LIMIT_SML1
Slow query, standard limit.
the array() calling protocol came about after MediaWiki 1.4rc1.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
Class to output help for an API module.