50 $out->setCopyrightUrl(
'https://www.mediawiki.org/wiki/Special:MyLanguage/Copyright' );
58 $html = ob_get_clean();
63 'mime' =>
'text/html',
98 if ( !is_array( $modules ) ) {
99 $modules = [ $modules ];
103 $out->addModuleStyles(
'mediawiki.hlist' );
104 $out->addModuleStyles(
'mediawiki.apihelp' );
105 if ( !empty( $options[
'toc'] ) ) {
106 $out->addModules(
'mediawiki.toc' );
108 $out->setPageTitle( $context->
msg(
'api-help-title' ) );
112 if ( count( $modules ) == 1 && $modules[0] instanceof
ApiMain &&
115 $cacheHelpTimeout = $context->
getConfig()->get(
'APICacheHelpTimeout' );
116 if ( $cacheHelpTimeout > 0 ) {
119 (
int)!empty( $options[
'toc'] ),
121 $cached =
$cache->get( $cacheKey );
123 $out->addHTML( $cached );
128 if (
$out->getHTML() !==
'' ) {
134 $options[
'recursivesubmodules'] = !empty( $options[
'recursivesubmodules'] );
135 $options[
'submodules'] = $options[
'recursivesubmodules'] || !empty( $options[
'submodules'] );
138 if ( empty( $options[
'nolead'] ) ) {
139 $msg = $context->
msg(
'api-help-lead' );
140 if ( !$msg->isDisabled() ) {
141 $out->addHTML( $msg->parseAsBlock() );
146 $html = self::getHelpInternal( $context, $modules, $options, $haveModules );
147 if ( !empty( $options[
'toc'] ) && $haveModules ) {
152 $helptitle = isset( $options[
'helptitle'] ) ? $options[
'helptitle'] : null;
153 $html = self::fixHelpLinks(
$out->getHTML(), $helptitle, $haveModules );
157 if ( $cacheKey !== null ) {
158 $cache->set( $cacheKey,
$out->getHTML(), $cacheHelpTimeout );
171 $formatter =
new HtmlFormatter(
$html );
172 $doc = $formatter->getDoc();
173 $xpath =
new DOMXPath( $doc );
174 $nodes = $xpath->query(
'//a[@href][not(contains(@class,\'apihelp-linktrail\'))]' );
175 foreach ( $nodes
as $node ) {
176 $href = $node->getAttribute(
'href' );
179 $href = rawurldecode( $href );
180 }
while ( $old !== $href );
181 if ( preg_match(
'!Special:ApiHelp/([^&/|#]+)((?:#.*)?)!', $href, $m ) ) {
182 if ( isset( $localModules[$m[1]] ) ) {
183 $href = $m[2] ===
'' ?
'#' . $m[1] : $m[2];
184 } elseif ( $helptitle !== null ) {
193 $node->setAttribute(
'href', $href );
194 $node->removeAttribute(
'title' );
198 return $formatter->getText();
229 $level = empty( $options[
'headerlevel'] ) ? 2 : $options[
'headerlevel'];
230 if ( empty( $options[
'tocnumber'] ) ) {
231 $tocnumber = [ 2 => 0 ];
233 $tocnumber = &$options[
'tocnumber'];
236 foreach ( $modules
as $module ) {
237 $tocnumber[$level]++;
238 $path = $module->getModulePath();
239 $module->setContext( $context );
250 if ( empty( $options[
'noheader'] ) || !empty( $options[
'toc'] ) ) {
253 while ( isset( $haveModules[$anchor] ) ) {
254 $anchor =
$path .
'|' . ++$i;
257 if ( $module->isMain() ) {
258 $headerContent = $context->
msg(
'api-help-main-header' )->parse();
260 'class' =>
'apihelp-header',
263 $name = $module->getModuleName();
264 $headerContent = $module->getParent()->getModuleManager()->getModuleGroup(
$name ) .
266 if ( $module->getModulePrefix() !==
'' ) {
267 $headerContent .=
' ' .
268 $context->
msg(
'parentheses', $module->getModulePrefix() )->parse();
274 'class' =>
'apihelp-header apihelp-module-name',
280 $headerAttr[
'id'] = $anchor;
282 $haveModules[$anchor] = [
283 'toclevel' => count( $tocnumber ),
286 'line' => $headerContent,
287 'number' => implode(
'.', $tocnumber ),
290 if ( empty( $options[
'noheader'] ) ) {
292 'h' . min( 6, $level ),
298 $haveModules[
$path] =
true;
303 for ( $m = $module; $m !== null; $m = $m->getParent() ) {
304 $name = $m->getModuleName();
305 if (
$name ===
'main_int' ) {
309 if ( count( $modules ) === 1 && $m === $modules[0] &&
310 !( !empty( $options[
'submodules'] ) && $m->getModuleManager() )
316 [
'href' =>
$link,
'class' =>
'apihelp-linktrail' ],
321 array_unshift( $links,
$link );
324 $help[
'header'] .= self::wrap(
325 $context->
msg(
'parentheses' )
326 ->rawParams( $context->
getLanguage()->pipeList( $links ) ),
327 'apihelp-linktrail',
'div'
331 $flags = $module->getHelpFlags();
333 [
'class' =>
'apihelp-block apihelp-flags' ] );
334 $msg = $context->
msg(
'api-help-flags' );
335 if ( !$msg->isDisabled() ) {
336 $help[
'flags'] .= self::wrap(
337 $msg->numParams( count(
$flags ) ),
'apihelp-block-head',
'div'
343 self::wrap( $context->
msg(
"api-help-flag-$flag" ),
"apihelp-flag-$flag" )
346 $sourceInfo = $module->getModuleSourceInfo();
348 if ( isset( $sourceInfo[
'namemsg'] ) ) {
349 $extname = $context->
msg( $sourceInfo[
'namemsg'] )->text();
351 $extname = $sourceInfo[
'name'];
355 $context->
msg(
'api-help-source', $extname, $sourceInfo[
'name'] ),
361 if ( isset( $sourceInfo[
'license-name'] ) ) {
362 $msg = $context->
msg(
'api-help-license',
$link, $sourceInfo[
'license-name'] );
364 $msg = $context->
msg(
'api-help-license-noname',
$link );
366 $msg = $context->
msg(
'api-help-license-unknown' );
369 self::wrap( $msg,
'apihelp-license' )
373 self::wrap( $context->
msg(
'api-help-source-unknown' ),
'apihelp-source' )
376 self::wrap( $context->
msg(
'api-help-license-unknown' ),
'apihelp-license' )
382 foreach ( $module->getFinalDescription()
as $msg ) {
383 $msg->setContext( $context );
384 $help[
'description'] .= $msg->parseAsBlock();
387 $urls = $module->getHelpUrls();
390 [
'class' =>
'apihelp-block apihelp-help-urls' ]
392 $msg = $context->
msg(
'api-help-help-urls' );
393 if ( !$msg->isDisabled() ) {
394 $help[
'help-urls'] .= self::wrap(
395 $msg->numParams( count(
$urls ) ),
'apihelp-block-head',
'div'
398 if ( !is_array(
$urls ) ) {
412 $dynamicParams = $module->dynamicParameterDocumentation();
414 if (
$params || $dynamicParams !== null ) {
416 [
'class' =>
'apihelp-block apihelp-parameters' ]
418 $msg = $context->
msg(
'api-help-parameters' );
419 if ( !$msg->isDisabled() ) {
420 $help[
'parameters'] .= self::wrap(
421 $msg->numParams( count(
$params ) ),
'apihelp-block-head',
'div'
426 $descriptions = $module->getFinalParamDescription();
429 if ( !is_array( $settings ) ) {
434 $module->encodeParamName(
$name ) );
438 if ( isset( $descriptions[
$name] ) ) {
439 foreach ( $descriptions[$name]
as $msg ) {
440 $msg->setContext( $context );
441 $description[] = $msg->parseAsBlock();
450 $info[] = $context->
msg(
'api-help-param-required' )->parse();
455 foreach ( $settings[ApiBase::PARAM_HELP_MSG_INFO]
as $i ) {
456 $tag = array_shift( $i );
457 $info[] = $context->
msg(
"apihelp-{$path}-paraminfo-{$tag}" )
458 ->numParams( count( $i ) )
459 ->params( $context->
getLanguage()->commaList( $i ) )
460 ->params( $module->getModulePrefix() )
470 if ( is_bool( $dflt ) ) {
472 } elseif ( is_string( $dflt ) || is_null( $dflt ) ) {
474 } elseif ( is_int( $dflt ) ) {
478 if ( isset( $settings[ApiBase::PARAM_TYPE] ) ) {
481 $hintPipeSeparated =
true;
484 if ( is_array(
$type ) ) {
489 $type = array_map(
function ( $v )
use ( $links ) {
491 if ( isset( $links[$v] ) ) {
492 $ret =
"[[{$links[$v]}|$ret]]";
496 $i = array_search(
'',
$type,
true );
497 if ( $i ===
false ) {
501 $type = $context->
msg(
'api-help-param-list-can-be-empty' )
502 ->numParams( count(
$type ) )
506 $info[] = $context->
msg(
'api-help-param-list' )
507 ->params( $multi ? 2 : 1 )
510 $hintPipeSeparated =
false;
519 foreach ( $map
as $v => $m ) {
520 $submodules[] =
"[[Special:ApiHelp/{$m}|{$v}]]";
523 $submodules = $module->getModuleManager()->getNames( $name );
525 $prefix = $module->isMain()
526 ?
'' : ( $module->getModulePath() .
'+' );
527 $submodules = array_map(
function ( $name )
use ( $prefix ) {
528 return "[[Special:ApiHelp/{$prefix}{$name}|{$name}]]";
531 $count = count( $submodules );
532 $info[] = $context->
msg(
'api-help-param-list' )
533 ->params( $multi ? 2 : 1 )
534 ->params( $context->
getLanguage()->commaList( $submodules ) )
536 $hintPipeSeparated =
false;
544 $info[] = $context->
msg(
'api-help-param-list' )
545 ->params( $multi ? 2 : 1 )
548 $hintPipeSeparated =
false;
556 $info[] = $context->
msg(
'api-help-param-list' )
557 ->params( $multi ? 2 : 1 )
558 ->params( $context->
getLanguage()->commaList( $tags ) )
560 $hintPipeSeparated =
false;
566 $info[] = $context->
msg(
'api-help-param-limit2' )
568 ->numParams( $settings[ApiBase::PARAM_MAX2] )
571 $info[] = $context->
msg(
'api-help-param-limit' )
592 if ( $suffix !==
'' ) {
594 $context->
msg(
"api-help-param-integer-$suffix" )
595 ->params( $multi ? 2 : 1 )
596 ->numParams( $min, $max )
602 $info[] = $context->
msg(
'api-help-param-upload' )
620 if ( is_string(
$type ) ) {
621 $msg = $context->
msg(
"api-help-param-type-$type" );
622 if ( !$msg->isDisabled() ) {
623 $info[] = $msg->params( $multi ? 2 : 1 )->parse();
629 if ( $hintPipeSeparated ) {
630 $extra[] = $context->
msg(
'api-help-param-multi-separate' )->parse();
633 $extra[] = $context->
msg(
'api-help-param-multi-max' )
638 $info[] = implode(
' ', $extra );
647 if ( $default ===
'' ) {
648 $info[] = $context->
msg(
'api-help-param-default-empty' )
650 } elseif ( $default !== null && $default !==
false ) {
651 $info[] = $context->
msg(
'api-help-param-default' )
656 if ( !array_filter( $description ) ) {
657 $description = [ self::wrap(
658 $context->
msg(
'api-help-param-no-description' ),
666 [
'class' =>
'info' ] );
667 $help[
'parameters'] .= self::wrap(
668 $context->
msg(
'api-help-param-deprecated' ),
669 'apihelp-deprecated',
'strong'
674 if ( $description ) {
675 $description = implode(
'', $description );
676 $description = preg_replace(
'!\s*</([oud]l)>\s*<\1>\s*!',
"\n", $description );
678 [
'class' =>
'description' ], $description );
681 foreach ( $info
as $i ) {
686 if ( $dynamicParams !== null ) {
688 $module->getModulePrefix(),
689 $module->getModuleName(),
690 $module->getModulePath()
694 [
'class' =>
'description' ], $dynamicParams->parse() );
701 $examples = $module->getExamplesMessages();
704 [
'class' =>
'apihelp-block apihelp-examples' ] );
705 $msg = $context->
msg(
'api-help-examples' );
706 if ( !$msg->isDisabled() ) {
707 $help[
'examples'] .= self::wrap(
708 $msg->numParams( count( $examples ) ),
'apihelp-block-head',
'div'
713 foreach ( $examples
as $qs => $msg ) {
715 $module->getModulePrefix(),
716 $module->getModuleName(),
717 $module->getModulePath()
724 Html::element(
'a', [
'href' => $link ],
"api.php?$qs" ) .
' ' .
726 $context->
msg(
'api-help-open-in-apisandbox' )->parse() )
733 $subtocnumber = $tocnumber;
734 $subtocnumber[$level + 1] = 0;
736 'submodules' => $options[
'recursivesubmodules'],
737 'headerlevel' => $level + 1,
738 'tocnumber' => &$subtocnumber,
742 if ( $options[
'submodules'] && $module->getModuleManager() ) {
743 $manager = $module->getModuleManager();
745 foreach ( $groups
as $group ) {
746 $names = $manager->getNames( $group );
749 $submodules[] = $manager->getModule( $name );
752 $help[
'submodules'] .= self::getHelpInternal(
760 $module->modifyHelp(
$help, $suboptions, $haveModules );
762 Hooks::run(
'APIHelpModifyOutput', [ $module, &
$help, $suboptions, &$haveModules ] );
785 $errorPrinter = $main->createPrinterByName( $main->getParameter(
'format' ) );
795 'submodules' =>
false,
796 'recursivesubmodules' =>
false,
805 =>
'apihelp-help-example-main',
806 'action=help&modules=query&submodules=1'
807 =>
'apihelp-help-example-submodules',
808 'action=help&recursivesubmodules=1'
809 =>
'apihelp-help-example-recursive',
810 'action=help&modules=help'
811 =>
'apihelp-help-example-help',
812 'action=help&modules=query+info|query+categorymembers'
813 =>
'apihelp-help-example-query',
819 'https://www.mediawiki.org/wiki/API:Main_page',
820 'https://www.mediawiki.org/wiki/API:FAQ',
821 'https://www.mediawiki.org/wiki/API:Quick_start_guide',
static generateTOC($tree, $lang=false)
Generate a table of contents from a section tree.
const PARAM_VALUE_LINKS
(string[]) When PARAM_TYPE is an array, this may be an array mapping those values to page titles whic...
static closeElement($element)
Returns "$element>".
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below...
static getMainWANInstance()
Get the main WAN cache object.
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
Interface for objects which can provide a MediaWiki context on request.
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
the array() calling protocol came about after MediaWiki 1.4rc1.
getResult()
Get the result object.
getLanguage()
Get the Language object.
wfScript($script= 'index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
static getTitleFor($name, $subpage=false, $fragment= '')
Get a localised Title object for a specified special page name.
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_DFLT
(null|boolean|integer|string) Default value of the parameter.
getMain()
Get the main module.
msg()
Get a Message object with context set.
const GET_VALUES_FOR_HELP
getAllowedParams() flag: When set, the result could take longer to generate, but should be more thoro...
static rawElement($element, $attribs=[], $contents= '')
Returns an HTML element in a string.
const PARAM_MAX
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
An IContextSource implementation which will inherit context from another source but allow individual ...
const PARAM_REQUIRED
(boolean) Is the parameter required?
const PARAM_HELP_MSG_INFO
(array) Specify additional information tags for the parameter.
extractRequestParams($parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user...
static makeMessage($msg, IContextSource $context, array $params=null)
Create a Message from a string or array.
it s the revision text itself In either if gzip is the revision text is gzipped $flags
static fixHelpLinks($html, $helptitle=null, $localModules=[])
Replace Special:ApiHelp links with links to api.php.
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
when a variable name is used in a it is silently declared as a new local masking the global
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:Associative array mapping language codes to prefixed links of the form"language:title".&$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':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
the value to return A Title object or null for latest to be modified or replaced by the hook handler or if authentication is not possible after cache objects are set for highlighting & $link
getConfig()
Get the site configuration.
static openElement($element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
wfEscapeWikiText($text)
Escapes the given text so that it may be output using addWikiText() without any linking, formatting, etc.
wfAppendQuery($url, $query)
Append a query string to an existing URL, which may or may not already have query string parameters a...
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
getModulePath()
Get the path to this module.
const LIMIT_SML2
Slow query, apihighlimits limit.
const PARAM_SUBMODULE_MAP
(string[]) When PARAM_TYPE is 'submodule', map parameter values to submodule paths.
getContext()
Get the base IContextSource object.
This is the main API class, used for both external and internal processing.
static getExtLicenseFileName($extDir)
Obtains the full path of an extensions copying or license file if one exists.
const NO_SIZE_CHECK
For addValue() and similar functions, do not check size while adding a value Don't use this unless yo...
getModuleName()
Get the name of the module being executed by this instance.
static getHelp(IContextSource $context, $modules, array $options)
Generate help for the specified modules.
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books $tag
const PARAM_MAX2
(integer) Max value allowed for the parameter for users with the apihighlimits right, for PARAM_TYPE 'limit'.
getLanguage()
Get the Language object.
namespace and then decline to actually register it & $namespaces
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
This class should be covered by a general architecture document which does not exist as of January 20...
parse()
Fully parse the text from wikitext to HTML.
static wrap(Message $msg, $class, $tag= 'span')
Wrap a message in HTML with a class.
static setSubelementsList(array &$arr, $names)
Causes the elements with the specified names to be output as subelements rather than attributes...
const LIMIT_SML1
Slow query, standard limit.
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
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
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 local content language as $wgContLang
This abstract class implements many basic API functions, and is the base of all API classes...
wfMemcKey()
Make a cache key for the local wiki.
getOutput()
Get the OutputPage object.
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'.
Class to output help for an API module.
static getVersion($flags= '', $lang=null)
Return a string of the MediaWiki version with Git revision if available.
static getValidNamespaces()
Returns an array of the namespaces (by integer id) that exist on the wiki.
static getDefaultInstance()
static element($element, $attribs=[], $contents= '')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
static getHelpInternal(IContextSource $context, array $modules, array $options, &$haveModules)
Recursively-called function to actually construct the help.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
getModuleFromPath($path)
Get a module from its module path.
Allows to change the fields on the form that will be generated $name