Manual:Hooks/ParserLimitReport

From MediaWiki.org
Jump to: navigation, search
ParserLimitReport
Available from version 1.12.0
called at the end of Parser::parse() when the parser will add a report about size and complexity of the text parsed as a HTML comment
Define function:
public static function onParserLimitReport( $parser, $limitReport ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ParserLimitReport": [
			"MyExtensionHooks::onParserLimitReport"
		]
	}
}

For MediaWiki ≤1.25:

$wgHooks['ParserLimitReport'][] = 'MyExtensionHooks::onParserLimitReport';
Called from: File(s): Parser.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:ParserLimitReport extensions.

Details[edit]

Used to create the NewPP parser report. Parameters:

  • $parser: Parser object
  • $limitReport: text that will be included (without comment tags); extensions are expected to append their own lines.

Hints[edit]

When adding some limts to a page and show that limit in the limit report, you should also add a limitation warning (Parser::limitationWarn) with a tracking category to get all pages, which reach that limit.