MediaWiki REL1_34
Scribunto_LuaStandaloneEngine Class Reference
Inheritance diagram for Scribunto_LuaStandaloneEngine:
Collaboration diagram for Scribunto_LuaStandaloneEngine:

Public Member Functions

 formatLimitData ( $key, &$value, &$report, $isHTML, $localize)
 Format limit report data.
 
 getPerformanceCharacteristics ()
 Get performance characteristics of the Lua engine/interpreter.
 
 getSoftwareInfo (array &$software)
 Get software information for Special:Version.
 
 load ()
 Initialise the interpreter and the base environment.
 
 reportLimitData (ParserOutput $output)
 Add limit report data to a ParserOutput object.
 
- Public Member Functions inherited from Scribunto_LuaEngine
 addWarning ( $text)
 Adds a warning to be displayed upon preview.
 
 callParserFunction ( $frameId, $function, $args)
 Handler for callParserFunction()
 
 checkNumber ( $funcName, $args, $index0)
 Workalike for luaL_checknumber()
 
 checkString ( $funcName, $args, $index0)
 Workalike for luaL_checkstring()
 
 checkType ( $funcName, $args, $index0, $type, $msgType)
 Workalike for luaL_checktype()
 
 destroy ()
 
 executeFunctionChunk ( $chunk, $frame)
 Execute a module function chunk.
 
 executeModule ( $chunk, $functionName, $frame)
 Execute a module chunk in a new isolated environment, and return the specified function.
 
 expandTemplate ( $frameId, $titleText, $args)
 Handler for expandTemplate()
 
 frameExists ( $frameId)
 Handler for frameExists()
 
 getAllExpandedArguments ( $frameId)
 Handler for getAllExpandedArguments()
 
 getCodeEditorLanguage ()
 Get the language for Ace code editor.
 
 getExpandedArgument ( $frameId, $name)
 Handler for getExpandedArgument()
 
 getFrameTitle ( $frameId)
 Handler for getTitle()
 
 getGeSHiLanguage ()
 Get the language for GeSHi syntax highlighter.
 
 getInterpreter ()
 Get the current interpreter object.
 
 getLuaLibDir ()
 Return the base path for Lua modules.
 
 incrementExpensiveFunctionCount ()
 Increment the expensive function count, and throw if limit exceeded.
 
 isSubsting ()
 Return whether the parser is currently substing.
 
 loadPackage ( $name)
 Handler for the loadPackage() callback.
 
 loadPHPLibrary ( $name)
 Handler for the loadPHPLibrary() callback.
 
 newChildFrame ( $frameId, $title, array $args)
 Handler for newChildFrame()
 
 newLuaError ( $message, $params=[])
 
 preprocess ( $frameId, $text)
 Handler for preprocess()
 
 registerInterface ( $moduleFileName, $interfaceFuncs, $setupOptions=[])
 Register a Lua Library.
 
 runConsole (array $params)
 Run an interactive console request.
 
 setTTL ( $ttl)
 Handler for setTTL()
 
- Public Member Functions inherited from ScribuntoEngineBase
 __construct (array $options)
 
 __destruct ()
 
 fetchModuleFromParser (Title $title)
 Load a module from some parser-defined template loading mechanism and register a parser output dependency.
 
 getDefaultExceptionParams ()
 
 getOption ( $optionName)
 Get an element from the configuration array.
 
 getParser ()
 
 getResourceUsage ( $resource)
 Get CPU and memory usage information, if the script engine provides it.
 
 getTitle ()
 
 newException ( $message, array $params=[])
 
 setTitle ( $title)
 
 validate ( $text, $chunkName=false)
 Validates the script and returns a Status object containing the syntax errors for the given code.
 

Public Attributes

array bool $initialStatus
 
- Public Attributes inherited from Scribunto_LuaEngine
const MAX_EXPAND_CACHE_SIZE = 100
 
- Public Attributes inherited from ScribuntoEngineBase
const CPU_SECONDS = 1
 
const MEM_PEAK_BYTES = 2
 

Protected Member Functions

 getClockTick ()
 
 newInterpreter ()
 
- Protected Member Functions inherited from Scribunto_LuaEngine
 formatHtmlLogs ( $logs, $localize)
 Format the logged data for HTML output.
 
 getFrameById ( $frameId)
 Helper function for the implementation of frame methods.
 
 getLogBuffer ()
 Get data logged by modules.
 
 loadLibraryFromFile ( $fileName)
 Load a library from the given file and execute it in the base environment.
 
 newModule ( $text, $chunkName)
 
 normalizeModuleFileName ( $fileName)
 Normalize a lua module to its full path.
 
- Protected Member Functions inherited from ScribuntoEngineBase
 getLibraries ( $engine, array $coreLibraries=[])
 Load a list of all libraries supported by this engine.
 
 getLibraryPaths ( $engine, array $coreLibraryPaths=[])
 Load a list of all paths libraries can be in for this engine.
 

Protected Attributes

Scribunto_LuaStandaloneInterpreter $interpreter
 
- Protected Attributes inherited from Scribunto_LuaEngine
 $availableLibraries = []
 
array $currentFrames = []
 
 $expandCache = []
 
Scribunto_LuaInterpreter $interpreter
 
 $loaded = false
 
array $mw
 
- Protected Attributes inherited from ScribuntoEngineBase
ScribuntoModuleBase[] $modules = []
 
array $options
 
Parser $parser
 
Title $title
 

Static Protected Attributes

static $clockTick
 
- Static Protected Attributes inherited from Scribunto_LuaEngine
static array $libraryClasses
 Libraries to load.
 
static array $libraryPaths
 Paths for modules that may be loaded from Lua.
 

Additional Inherited Members

- Static Public Member Functions inherited from Scribunto_LuaEngine
static newAutodetectEngine (array $options)
 If luasandbox is installed and usable then use it, otherwise.
 

Detailed Description

Definition at line 7 of file LuaStandaloneEngine.php.

Member Function Documentation

◆ formatLimitData()

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

Format limit report data.

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

Reimplemented from ScribuntoEngineBase.

Definition at line 64 of file LuaStandaloneEngine.php.

References $lang, $wgLang, and Scribunto_LuaEngine\formatHtmlLogs().

◆ getClockTick()

Scribunto_LuaStandaloneEngine::getClockTick ( )
protected
Returns
mixed

Definition at line 87 of file LuaStandaloneEngine.php.

References $clockTick.

Referenced by reportLimitData().

◆ getPerformanceCharacteristics()

Scribunto_LuaStandaloneEngine::getPerformanceCharacteristics ( )

Get performance characteristics of the Lua engine/interpreter.

phpCallsRequireSerialization: boolean whether calls between PHP and Lua functions require (slow) serialization of parameters and return values

Returns
array

Reimplemented from Scribunto_LuaEngine.

Definition at line 26 of file LuaStandaloneEngine.php.

◆ getSoftwareInfo()

Scribunto_LuaStandaloneEngine::getSoftwareInfo ( array & $software)

Get software information for Special:Version.

Parameters
array&$software

Reimplemented from ScribuntoEngineBase.

Definition at line 108 of file LuaStandaloneEngine.php.

References Scribunto_LuaStandaloneInterpreter\getLuaVersion().

◆ load()

Scribunto_LuaStandaloneEngine::load ( )

Initialise the interpreter and the base environment.

Reimplemented from Scribunto_LuaEngine.

Definition at line 17 of file LuaStandaloneEngine.php.

Referenced by reportLimitData().

◆ newInterpreter()

Scribunto_LuaStandaloneEngine::newInterpreter ( )
protected
Returns
Scribunto_LuaStandaloneInterpreter

Reimplemented from Scribunto_LuaEngine.

Definition at line 102 of file LuaStandaloneEngine.php.

◆ reportLimitData()

Scribunto_LuaStandaloneEngine::reportLimitData ( ParserOutput $output)

Add limit report data to a ParserOutput object.

Parameters
ParserOutput$outputParserOutput object in which to add limit data
Returns
null

Reimplemented from ScribuntoEngineBase.

Definition at line 32 of file LuaStandaloneEngine.php.

References ParserOutput\addModules(), getClockTick(), Scribunto_LuaEngine\getLogBuffer(), load(), and ParserOutput\setLimitReportData().

Member Data Documentation

◆ $clockTick

Scribunto_LuaStandaloneEngine::$clockTick
staticprotected

Definition at line 8 of file LuaStandaloneEngine.php.

Referenced by getClockTick().

◆ $initialStatus

array bool Scribunto_LuaStandaloneEngine::$initialStatus

Definition at line 10 of file LuaStandaloneEngine.php.

◆ $interpreter

Scribunto_LuaStandaloneInterpreter Scribunto_LuaStandaloneEngine::$interpreter
protected

Definition at line 15 of file LuaStandaloneEngine.php.


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