41 $this->
getMain()->setCacheMode(
'anon-public-user-private' );
54 $titleProvided =
false;
58 $titleProvided =
true;
65 $model =
$params[
'contentmodel'];
66 $format =
$params[
'contentformat'];
68 $prop = array_flip(
$params[
'prop'] );
70 if ( isset(
$params[
'section'] ) ) {
71 $this->section =
$params[
'section'];
72 if ( !preg_match(
'/^((T-)?\d+|new)$/', $this->section ) ) {
76 $this->section =
false;
89 if ( !is_null( $oldid ) || !is_null( $pageid ) || !is_null(
$page ) ) {
90 if ( $this->section ===
'new' ) {
91 $this->
dieWithError(
'apierror-invalidparammix-parse-new-section',
'invalidparammix' );
93 if ( !is_null( $oldid ) ) {
97 $this->
dieWithError( [
'apierror-nosuchrevid', $oldid ] );
103 [
'apierror-permissiondenied', $this->
msg(
'action-deletedtext' ) ]
107 $titleObj =
$rev->getTitle();
116 if ( !$suppressCache &&
$rev->getId() == $pageObj->getLatest() ) {
119 $pageid, isset( $prop[
'wikitext'] ) );
123 if ( $this->section !==
false ) {
130 $p_result = $this->
content->getParserOutput( $titleObj,
$rev->getId(), $popts );
137 if ( !is_null( $pageid ) ) {
138 $reqParams[
'pageids'] = $pageid;
140 $reqParams[
'titles'] =
$page;
146 $redirValues = $pageSet->getRedirectTitlesAsResult( $this->
getResult() );
149 foreach ( $pageSet->getRedirectTitles()
as $title ) {
150 $to =
$title->getFullText();
152 $pageParams = [
'title' => $to ];
153 } elseif ( !is_null( $pageid ) ) {
154 $pageParams = [
'pageid' => $pageid ];
156 $pageParams = [
'title' =>
$page ];
160 $titleObj = $pageObj->getTitle();
161 if ( !$titleObj || !$titleObj->exists() ) {
168 if ( isset( $prop[
'revid'] ) ) {
169 $oldid = $pageObj->getLatest();
177 $suppressCache = $suppressCache ||
179 $params[
'disablelimitreport'] ||
184 if ( $suppressCache ) {
186 $p_result = $this->
content->getParserOutput( $titleObj,
null, $popts );
190 isset( $prop[
'wikitext'] ) );
194 $titleObj = Title::newFromText(
$title );
195 if ( !$titleObj || $titleObj->isExternal() ) {
199 if ( $titleObj->canExist() ) {
208 $textProvided = !is_null( $text );
210 if ( !$textProvided ) {
211 if ( $titleProvided && ( $prop ||
$params[
'generatexml'] ) ) {
212 $this->
addWarning(
'apiwarn-parse-titlewithouttext' );
220 if ( $textProvided && !$titleProvided && is_null( $model ) ) {
222 $this->
addWarning( [
'apiwarn-parse-nocontentmodel', $model ] );
229 'wrap' =>
ApiMessage::create(
'apierror-contentserializationexception',
'parseerror' )
233 if ( $this->section !==
false ) {
234 if ( $this->section ===
'new' ) {
236 if ( !is_null(
$params[
'sectiontitle'] ) &&
$params[
'sectiontitle'] !==
'' ) {
245 $this->pstContent = $this->
content->preSaveTransform( $titleObj, $this->
getUser(), $popts );
250 $result_array[
'text'] = $this->pstContent->serialize( $format );
252 if ( isset( $prop[
'wikitext'] ) ) {
253 $result_array[
'wikitext'] = $this->
content->serialize( $format );
256 if ( !is_null(
$params[
'summary'] ) ||
257 ( !is_null(
$params[
'sectiontitle'] ) && $this->section ===
'new' )
270 $p_result = $this->pstContent->getParserOutput( $titleObj,
null, $popts );
272 $p_result = $this->
content->getParserOutput( $titleObj,
null, $popts );
278 $result_array[
'title'] = $titleObj->getPrefixedText();
279 $result_array[
'pageid'] = $pageid ?: $pageObj->getId();
281 if ( !is_null( $oldid ) ) {
282 $result_array[
'revid'] = intval( $oldid );
285 if (
$params[
'redirects'] && !is_null( $redirValues ) ) {
286 $result_array[
'redirects'] = $redirValues;
290 $p_result->setTOCEnabled(
false );
293 if ( isset( $prop[
'text'] ) ) {
294 $result_array[
'text'] = $p_result->getText();
298 if ( !is_null(
$params[
'summary'] ) ||
299 ( !is_null(
$params[
'sectiontitle'] ) && $this->section ===
'new' )
305 if ( isset( $prop[
'langlinks'] ) ) {
306 $langlinks = $p_result->getLanguageLinks();
308 if (
$params[
'effectivelanglinks'] ) {
312 Hooks::run(
'LanguageLinks', [ $titleObj, &$langlinks, &$linkFlags ] );
318 if ( isset( $prop[
'langlinks'] ) ) {
321 if ( isset( $prop[
'categories'] ) ) {
324 if ( isset( $prop[
'categorieshtml'] ) ) {
325 $result_array[
'categorieshtml'] = $this->
categoriesHtml( $p_result->getCategories() );
328 if ( isset( $prop[
'links'] ) ) {
329 $result_array[
'links'] = $this->
formatLinks( $p_result->getLinks() );
331 if ( isset( $prop[
'templates'] ) ) {
332 $result_array[
'templates'] = $this->
formatLinks( $p_result->getTemplates() );
334 if ( isset( $prop[
'images'] ) ) {
335 $result_array[
'images'] = array_keys( $p_result->getImages() );
337 if ( isset( $prop[
'externallinks'] ) ) {
338 $result_array[
'externallinks'] = array_keys( $p_result->getExternalLinks() );
340 if ( isset( $prop[
'sections'] ) ) {
341 $result_array[
'sections'] = $p_result->getSections();
343 if ( isset( $prop[
'parsewarnings'] ) ) {
344 $result_array[
'parsewarnings'] = $p_result->getWarnings();
347 if ( isset( $prop[
'displaytitle'] ) ) {
348 $result_array[
'displaytitle'] = $p_result->getDisplayTitle() ?:
349 $titleObj->getPrefixedText();
352 if ( isset( $prop[
'headitems'] ) ) {
353 $result_array[
'headitems'] = $this->
formatHeadItems( $p_result->getHeadItems() );
354 $this->
addDeprecation(
'apiwarn-deprecation-parse-headitems',
'action=parse&prop=headitems' );
357 if ( isset( $prop[
'headhtml'] ) ) {
365 $output->addParserOutputMetadata( $p_result );
371 if ( isset( $prop[
'modules'] ) ) {
372 $result_array[
'modules'] = array_values( array_unique( $p_result->getModules() ) );
373 $result_array[
'modulescripts'] = array_values( array_unique( $p_result->getModuleScripts() ) );
374 $result_array[
'modulestyles'] = array_values( array_unique( $p_result->getModuleStyles() ) );
377 if ( isset( $prop[
'jsconfigvars'] ) ) {
378 $result_array[
'jsconfigvars'] =
382 if ( isset( $prop[
'encodedjsconfigvars'] ) ) {
383 $result_array[
'encodedjsconfigvars'] = FormatJson::encode(
384 $p_result->getJsConfigVars(),
false, FormatJson::ALL_OK
389 if ( isset( $prop[
'modules'] ) &&
390 !isset( $prop[
'jsconfigvars'] ) && !isset( $prop[
'encodedjsconfigvars'] ) ) {
391 $this->
addWarning(
'apiwarn-moduleswithoutvars' );
394 if ( isset( $prop[
'indicators'] ) ) {
395 $result_array[
'indicators'] = (
array)$p_result->getIndicators();
399 if ( isset( $prop[
'iwlinks'] ) ) {
400 $result_array[
'iwlinks'] = $this->
formatIWLinks( $p_result->getInterwikiLinks() );
403 if ( isset( $prop[
'wikitext'] ) ) {
404 $result_array[
'wikitext'] = $this->
content->serialize( $format );
406 if ( !is_null( $this->pstContent ) ) {
407 $result_array[
'psttext'] = $this->pstContent->serialize( $format );
411 if ( isset( $prop[
'properties'] ) ) {
412 $result_array[
'properties'] = (
array)$p_result->getProperties();
416 if ( isset( $prop[
'limitreportdata'] ) ) {
417 $result_array[
'limitreportdata'] =
420 if ( isset( $prop[
'limitreporthtml'] ) ) {
425 if ( isset( $prop[
'parsetree'] ) ||
$params[
'generatexml'] ) {
427 $this->
dieWithError(
'apierror-parsetree-notwikitext',
'notwikitext' );
430 $wgParser->startExternalParse( $titleObj, $popts, Parser::OT_PREPROCESS );
432 if ( is_callable( [ $dom,
'saveXML' ] ) ) {
433 $xml = $dom->saveXML();
435 $xml = $dom->__toString();
437 $result_array[
'parsetree'] = $xml;
444 'categories' =>
'cl',
448 'externallinks' =>
'el',
453 'indicators' =>
'ind',
454 'modulescripts' =>
'm',
455 'modulestyles' =>
'm',
456 'properties' =>
'pp',
457 'limitreportdata' =>
'lr',
458 'parsewarnings' =>
'pw'
474 $popts->enableLimitReport( !
$params[
'disablepp'] && !
$params[
'disablelimitreport'] );
475 $popts->setIsPreview(
$params[
'preview'] ||
$params[
'sectionpreview'] );
476 $popts->setIsSectionPreview(
$params[
'sectionpreview'] );
477 $popts->setEditSection( !
$params[
'disableeditsection'] );
478 if (
$params[
'disabletidy'] ) {
479 $popts->setTidy(
false );
483 $suppressCache =
false;
484 Hooks::run(
'ApiMakeParserOptions',
485 [ $popts, $pageObj->
getTitle(),
$params, $this, &$reset, &$suppressCache ] );
487 return [ $popts, $reset, $suppressCache ];
500 if ( $this->section !==
false && $this->
content !==
null ) {
502 return $this->
content->getParserOutput(
$page->getTitle(),
null, $popts );
507 $pout =
$page->getParserOutput( $popts );
511 if ( $getWikitext ) {
528 if ( $this->section !==
false &&
$content !==
null ) {
532 ? $this->
msg(
'pageid', $pageId )
533 :
$page->getTitle()->getPrefixedText()
550 $this->
dieWithError( [
'apierror-nosuchsection-what', $this->section, $what ],
'nosuchsection' );
553 $this->
dieWithError( [
'apierror-sectionsnotsupported-what', $what ],
'nosuchsection' );
569 $summary = !is_null(
$params[
'summary'] ) ?
$params[
'summary'] :
'';
570 $sectionTitle = !is_null(
$params[
'sectiontitle'] ) ?
$params[
'sectiontitle'] :
'';
572 if ( $this->section ===
'new' && ( $sectionTitle ===
'' || $summary ===
'' ) ) {
573 if ( $sectionTitle !==
'' ) {
574 $summary =
$params[
'sectiontitle'];
576 if ( $summary !==
'' ) {
577 $summary =
wfMessage(
'newsectionsummary' )
578 ->rawParams(
$wgParser->stripSectionName( $summary ) )
579 ->inContentLanguage()->text();
589 $bits = explode(
':',
$link, 2 );
592 $entry[
'lang'] = $bits[0];
596 $entry[
'langname'] = Language::fetchLanguageName(
598 $this->getLanguage()->getCode()
602 $entry[
'autonym'] = Language::fetchLanguageName(
$title->getInterwiki() );
621 $db = $this->
getDB();
622 $res = $db->select( [
'page',
'page_props' ],
623 [
'page_title',
'pp_propname' ],
624 $lb->constructSet(
'page', $db ),
628 'LEFT JOIN', [
'pp_propname' =>
'hiddencat',
'pp_page = page_id' ]
632 foreach (
$res as $row ) {
633 $hiddencats[$row->page_title] = isset( $row->pp_propname );
636 $linkCache = LinkCache::singleton();
638 foreach ( $links
as $link => $sortkey ) {
640 $entry[
'sortkey'] = $sortkey;
643 if ( !isset( $hiddencats[
$link] ) ) {
644 $entry[
'missing'] =
true;
649 $linkCache->addBadLinkObj(
$title );
650 if (
$title->isKnown() ) {
651 $entry[
'known'] =
true;
653 } elseif ( $hiddencats[
$link] ) {
654 $entry[
'hidden'] =
true;
671 foreach ( $links
as $ns => $nslinks ) {
672 foreach ( $nslinks
as $title => $id ) {
676 $entry[
'exists'] = $id != 0;
689 $entry[
'prefix'] = $prefix;
691 $title = Title::newFromText(
"{$prefix}:{$title}" );
708 $entry[
'tag'] =
$tag;
721 $entry[
'name'] =
$name;
722 if ( !is_array(
$value ) ) {
726 $entry = array_merge( $entry,
$value );
734 foreach ( $mapping
as $key =>
$name ) {
735 if ( isset( $array[$key] ) ) {
752 'redirects' =>
false,
758 'images|externallinks|sections|revid|displaytitle|iwlinks|' .
759 'properties|parsewarnings',
777 'encodedjsconfigvars',
793 'effectivelanglinks' =>
false,
802 'disablelimitreport' =>
false,
803 'disableeditsection' =>
false,
804 'disabletidy' =>
false,
813 'sectionpreview' =>
false,
814 'disabletoc' =>
false,
826 'action=parse&page=Project:Sandbox'
827 =>
'apihelp-parse-example-page',
828 'action=parse&text={{Project:Sandbox}}&contentmodel=wikitext'
829 =>
'apihelp-parse-example-text',
830 'action=parse&text={{PAGENAME}}&title=Test'
831 =>
'apihelp-parse-example-texttitle',
832 'action=parse&summary=Some+[[link]]&prop='
833 =>
'apihelp-parse-example-summary',
838 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Parsing_wikitext#parse';
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
if(! $wgRequest->checkUrlExtension()) if(isset($_SERVER[ 'PATH_INFO']) &&$_SERVER[ 'PATH_INFO'] !='') if(! $wgEnableAPI) $wgTitle
This abstract class implements many basic API functions, and is the base of all API classes.
const PARAM_DEPRECATED
(boolean) Is the parameter deprecated (will show a warning)?
getDB()
Gets a default replica DB connection object.
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
getMain()
Get the main module.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
const PARAM_HELP_MSG_PER_VALUE
((string|array|Message)[]) When PARAM_TYPE is an array, this is an array mapping those values to $msg...
addDeprecation( $msg, $feature, $data=[])
Add a deprecation warning for this module.
getResult()
Get the result object.
requireMaxOneParameter( $params, $required)
Die if more than one of a certain set of parameters is set and not false.
dieWithException( $exception, array $options=[])
Abort execution with an error derived from an exception.
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
addWarning( $msg, $code=null, $data=null)
Add a warning for this module.
getModuleName()
Get the name of the module being executed by this instance.
getTitleOrPageId( $params, $load=false)
Get a WikiPage object from a title or pageid param, if possible.
checkTitleUserPermissions(Title $title, $actions, $user=null)
Helper function for permission-denied errors.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
This is the main API class, used for both external and internal processing.
static create( $msg, $code=null, array $data=null)
Create an IApiMessage for the message.
This class contains a list of pages that the client has requested.
formatSummary( $title, $params)
This mimicks the behavior of EditPage in formatting a summary.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
getParsedContent(WikiPage $page, $popts, $pageId=null, $getWikitext=false)
formatHeadItems( $headItems)
getExamplesMessages()
Returns usage examples for this module.
formatCategoryLinks( $links)
formatLimitReportData( $limitReportData)
categoriesHtml( $categories)
makeParserOptions(WikiPage $pageObj, array $params)
Constructs a ParserOptions object.
getContent(WikiPage $page, $pageId=null)
Get the content for the given page and the requested section.
getSectionContent(Content $content, $what)
Extract the requested section from the given Content.
getHelpUrls()
Return links to more detailed help pages about the module.
setIndexedTagNames(&$array, $mapping)
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
static setArrayType(array &$arr, $type, $kvpKeyName=null)
Set the array data type.
static addMetadataToResultVars( $vars, $forceHash=true)
Add the correct metadata to an array of vars we want to export through the API.
const META_SUBELEMENTS
Key for the 'subelements' metadata item.
const META_BC_SUBELEMENTS
Key for the 'BC subelements' metadata item.
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
static setContentValue(array &$arr, $name, $value, $flags=0)
Add an output value to the array by name and mark as META_CONTENT.
static setIndexedTagNameRecursive(array &$arr, $tag)
Set indexed tag name on $arr and all subarrays.
static newFromTitle( $title, IContextSource $context)
Create an Article object of the appropriate class for the given page.
static getAllContentFormats()
static makeContent( $text, Title $title=null, $modelId=null, $format=null)
Convenience function for creating a Content object from a given textual representation.
static getContentModels()
getUser()
Get the User object.
msg()
Get a Message object with context set Parameters are the same as wfMessage()
getContext()
Get the base IContextSource object.
An IContextSource implementation which will inherit context from another source but allow individual ...
static getPreviewLimitReport( $output)
Get the Limit report for page previews.
WebRequest clone which takes values from a provided array.
Class representing a list of titles The execute() method checks them all for existence and adds them ...
setArray( $array)
Set the link list to a given 2-d array First key is the namespace, second is the DB key,...
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
Exception representing a failure to serialize or unserialize a content object.
This class should be covered by a general architecture document which does not exist as of January 20...
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
Class representing a MediaWiki article and history.
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
getLatest()
Get the page_latest field.
makeParserOptions( $context)
Get parser options suitable for rendering the primary article wikitext.
getTitle()
Get the title object of the article.
per default it will return the text for text based content
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
when a variable name is used in a it is silently declared as a new local masking the global
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
const CONTENT_MODEL_WIKITEXT
this hook is for auditing only $req
the array() calling protocol came about after MediaWiki 1.4rc1.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup 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 the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object & $output
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 $page
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
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books $tag
namespace and then decline to actually register it file or subcat img or subcat $title
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
usually copyright or history_copyright This message must be in HTML not wikitext & $link
Allows to change the fields on the form that will be generated $name
Using a hook running we can avoid having all this option specific stuff in our mainline code Using the function array $article
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
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
Base interface for content objects.
getOutput()
Get the OutputPage object.
getSkin()
Get the Skin object.
linkcache txt The LinkCache class maintains a list of article titles and the information about whether or not the article exists in the database This is used to mark up links when displaying a page If the same link appears more than once on any page then it only has to be looked up once In most cases link lookups are done in batches with the LinkBatch class or the equivalent in so the link cache is mostly useful for short snippets of parsed and for links in the navigation areas of the skin The link cache was formerly used to track links used in a document for the purposes of updating the link tables This application is now deprecated To create a you can use the following $titles