MediaWiki REL1_34
ScribuntoHooks Class Reference

Hooks for the Scribunto extension. More...

Static Public Member Functions

static beforeEditButtons (EditPage &$editor, array &$buttons, &$tabindex)
 EditPageBeforeEditButtons hook.
 
static clearState (Parser &$parser)
 Called when the interpreter is to be reset.
 
static contentHandlerDefaultModelFor (Title $title, &$model)
 Set the Scribunto content handler for modules.
 
static formatLimitData ( $key, &$value, &$report, $isHTML, $localize)
 Formats the limit report data.
 
static getCodeLanguage (Title $title, &$languageCode)
 
static getSoftwareInfo (array &$software)
 Get software information for Special:Version.
 
static invokeHook (Parser &$parser, PPFrame $frame, array $args)
 Hook function for {{#invoke:module|func}}.
 
static onRegistration ()
 Define content handler constant upon extension registration.
 
static parserCloned (Parser $parser)
 Called when the parser is cloned.
 
static reportLimitData (Parser $parser, ParserOutput $output)
 Adds report of number of evaluations by the single wikitext page.
 
static reportTiming ( $moduleName, $functionName, $timing)
 Record stats on slow function calls.
 
static setupParserHook (Parser &$parser)
 Register parser hooks.
 
static showDocPageHeader (Article &$article, &$outputDone, &$pcache)
 
static showReadOnlyFormInitial (EditPage $editor, OutputPage $output)
 EditPage::showReadOnlyForm:initial hook.
 
static showStandardInputsOptions (EditPage $editor, OutputPage $output, &$tab)
 EditPage::showStandardInputs:options hook.
 
static validateScript (IContextSource $context, Content $content, Status $status)
 

Detailed Description

Hooks for the Scribunto extension.

Definition at line 30 of file Hooks.php.

Member Function Documentation

◆ beforeEditButtons()

static ScribuntoHooks::beforeEditButtons ( EditPage & $editor,
array & $buttons,
& $tabindex )
static

EditPageBeforeEditButtons hook.

Parameters
EditPage&$editor
array&$buttonsButton array
int&$tabindexCurrent tabindex
Returns
bool

Definition at line 344 of file Hooks.php.

References EditPage\getTitle().

◆ clearState()

static ScribuntoHooks::clearState ( Parser & $parser)
static

Called when the interpreter is to be reset.

Parameters
Parser&$parser
Returns
bool

Definition at line 69 of file Hooks.php.

References Scribunto\resetParserEngine().

◆ contentHandlerDefaultModelFor()

static ScribuntoHooks::contentHandlerDefaultModelFor ( Title $title,
& $model )
static

Set the Scribunto content handler for modules.

Parameters
Title$title
string&$model
Returns
bool

Definition at line 263 of file Hooks.php.

References $title, Scribunto\isDocPage(), and NS_MODULE.

Referenced by ScribuntoHooksTest\testContentHandlerDefaultModelFor().

◆ formatLimitData()

static ScribuntoHooks::formatLimitData ( $key,
& $value,
& $report,
$isHTML,
$localize )
static

Formats the limit report data.

Parameters
string$key
mixed&$value
string&$report
bool$isHTML
bool$localize
Returns
bool

Definition at line 300 of file Hooks.php.

References Scribunto\newDefaultEngine().

◆ getCodeLanguage()

static ScribuntoHooks::getCodeLanguage ( Title $title,
& $languageCode )
static
Parameters
Title$title
string&$languageCode
Returns
bool

Definition at line 242 of file Hooks.php.

References $title, and Scribunto\newDefaultEngine().

◆ getSoftwareInfo()

static ScribuntoHooks::getSoftwareInfo ( array & $software)
static

Get software information for Special:Version.

Parameters
array&$software
Returns
bool

Definition at line 45 of file Hooks.php.

References Scribunto\newDefaultEngine(), and NS_SPECIAL.

◆ invokeHook()

static ScribuntoHooks::invokeHook ( Parser & $parser,
PPFrame $frame,
array $args )
static

Hook function for {{#invoke:module|func}}.

Parameters
Parser&$parser
PPFrame$frame
array$args
Exceptions
MWException
ScribuntoException
Returns
string

Definition at line 95 of file Hooks.php.

References $args, $title, Parser\addTrackingCategory(), PPFrame\expand(), Parser\getOutput(), Scribunto\getParserEngine(), ScribuntoException\getScriptTraceHtml(), PPFrame\newChild(), NS_MODULE, reportTiming(), and wfMessage().

◆ onRegistration()

static ScribuntoHooks::onRegistration ( )
static

Define content handler constant upon extension registration.

Definition at line 35 of file Hooks.php.

◆ parserCloned()

static ScribuntoHooks::parserCloned ( Parser $parser)
static

Called when the parser is cloned.

Parameters
Parser$parser
Returns
bool

Definition at line 80 of file Hooks.php.

◆ reportLimitData()

static ScribuntoHooks::reportLimitData ( Parser $parser,
ParserOutput $output )
static

Adds report of number of evaluations by the single wikitext page.

Parameters
Parser$parser
ParserOutput$output
Returns
bool

Definition at line 282 of file Hooks.php.

References Scribunto\getParserEngine(), and Scribunto\isParserEnginePresent().

◆ reportTiming()

static ScribuntoHooks::reportTiming ( $moduleName,
$functionName,
$timing )
static

Record stats on slow function calls.

Parameters
string$moduleName
string$functionName
int$timingFunction execution time in milliseconds.

Definition at line 185 of file Hooks.php.

References $cache, and CACHE_NONE.

Referenced by invokeHook().

◆ setupParserHook()

static ScribuntoHooks::setupParserHook ( Parser & $parser)
static

Register parser hooks.

Parameters
Parser&$parser
Returns
bool

Definition at line 58 of file Hooks.php.

References Parser\setFunctionHook().

◆ showDocPageHeader()

static ScribuntoHooks::showDocPageHeader ( Article & $article,
& $outputDone,
& $pcache )
static
Parameters
Article&$article
bool&$outputDone
bool&$pcache
Returns
bool

Definition at line 391 of file Hooks.php.

References $title, Article\getContext(), Article\getTitle(), Scribunto\isDocPage(), and wfMessage().

◆ showReadOnlyFormInitial()

static ScribuntoHooks::showReadOnlyFormInitial ( EditPage $editor,
OutputPage $output )
static

EditPage::showReadOnlyForm:initial hook.

Parameters
EditPage$editor
OutputPage$output
Returns
bool

Definition at line 328 of file Hooks.php.

References OutputPage\addModules(), and EditPage\getTitle().

◆ showStandardInputsOptions()

static ScribuntoHooks::showStandardInputsOptions ( EditPage $editor,
OutputPage $output,
& $tab )
static

EditPage::showStandardInputs:options hook.

Parameters
EditPage$editor
OutputPage$output
int&$tabCurrent tabindex
Returns
bool

Definition at line 313 of file Hooks.php.

References OutputPage\addModules(), and EditPage\getTitle().

◆ validateScript()

static ScribuntoHooks::validateScript ( IContextSource $context,
Content $content,
Status $status )
static
Parameters
IContextSource$context
Content$content
Status$status
Returns
bool

Definition at line 357 of file Hooks.php.

References $content, $context, $line, $title, and StatusValue\merge().


The documentation for this class was generated from the following file: