MediaWiki  1.34.0
Scribunto Class Reference

Static function collection for general extension support. More...

Static Public Member Functions

static getDocPage (Title $title)
 Return the Title for the documentation page. More...
 
static getParserEngine (Parser $parser)
 Get an engine instance for the given parser, and cache it in the parser so that subsequent calls to this function for the same parser will return the same engine. More...
 
static isDocPage (Title $title, Title &$forModule=null)
 Test whether the page should be considered a documentation page. More...
 
static isParserEnginePresent (Parser $parser)
 Check if an engine instance is present in the given parser. More...
 
static newDefaultEngine ( $extraOptions=[])
 Create a new engine object with default parameters. More...
 
static newEngine ( $options)
 Create a new engine object with specified parameters. More...
 
static resetParserEngine (Parser $parser)
 Remove the current engine instance from the parser. More...
 

Public Attributes

const LOCAL = 'local'
 

Detailed Description

Static function collection for general extension support.

Definition at line 6 of file Common.php.

Member Function Documentation

◆ getDocPage()

static Scribunto::getDocPage ( Title  $title)
static

Return the Title for the documentation page.

Parameters
Title$title
Returns
Title|null

Definition at line 122 of file Common.php.

References $title, Title\newFromText(), and wfMessage().

Referenced by ScribuntoContent\fillParserOutput().

◆ getParserEngine()

static Scribunto::getParserEngine ( Parser  $parser)
static

Get an engine instance for the given parser, and cache it in the parser so that subsequent calls to this function for the same parser will return the same engine.

Parameters
Parser$parser
Returns
ScribuntoEngineBase

Definition at line 56 of file Common.php.

References newDefaultEngine().

Referenced by ScribuntoHooks\invokeHook(), ScribuntoHooks\reportLimitData(), and ApiScribuntoConsole\runConsole().

◆ isDocPage()

static Scribunto::isDocPage ( Title  $title,
Title $forModule = null 
)
static

Test whether the page should be considered a documentation page.

Parameters
Title$title
Title | null&$forModuleModule for which this is a doc page
Returns
bool

Definition at line 92 of file Common.php.

References $title, Title\makeTitleSafe(), Title\newFromText(), NS_MODULE, and wfMessage().

Referenced by ScribuntoHooks\contentHandlerDefaultModelFor(), and ScribuntoHooks\showDocPageHeader().

◆ isParserEnginePresent()

static Scribunto::isParserEnginePresent ( Parser  $parser)
static

Check if an engine instance is present in the given parser.

Parameters
Parser$parser
Returns
bool

Definition at line 70 of file Common.php.

Referenced by ScribuntoHooks\reportLimitData().

◆ newDefaultEngine()

static Scribunto::newDefaultEngine (   $extraOptions = [])
static

Create a new engine object with default parameters.

Parameters
array$extraOptionsExtra options to pass to the constructor, in addition to the configured options
Exceptions
MWException
Returns
ScribuntoEngineBase

Definition at line 32 of file Common.php.

References newEngine().

Referenced by ScribuntoContent\fillParserOutput(), ScribuntoHooks\formatLimitData(), ScribuntoHooks\getCodeLanguage(), getParserEngine(), ScribuntoHooks\getSoftwareInfo(), and ScribuntoContent\validate().

◆ newEngine()

static Scribunto::newEngine (   $options)
static

Create a new engine object with specified parameters.

Parameters
array$options
Returns
ScribuntoEngineBase

Definition at line 15 of file Common.php.

Referenced by Scribunto_LuaEngine\newAutodetectEngine(), and newDefaultEngine().

◆ resetParserEngine()

static Scribunto::resetParserEngine ( Parser  $parser)
static

Remove the current engine instance from the parser.

Parameters
Parser$parser

Definition at line 78 of file Common.php.

Referenced by ScribuntoHooks\clearState().

Member Data Documentation

◆ LOCAL

const Scribunto::LOCAL = 'local'

Definition at line 7 of file Common.php.


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