MediaWiki  1.34.0
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. More...
 
 getPerformanceCharacteristics ()
 Get performance characteristics of the Lua engine/interpreter. More...
 
 getSoftwareInfo (array &$software)
 Get software information for Special:Version. More...
 
 load ()
 Initialise the interpreter and the base environment. More...
 
 reportLimitData (ParserOutput $output)
 Add limit report data to a ParserOutput object. More...
 
- Public Member Functions inherited from Scribunto_LuaEngine
 addWarning ( $text)
 Adds a warning to be displayed upon preview. More...
 
 callParserFunction ( $frameId, $function, $args)
 Handler for callParserFunction() More...
 
 checkNumber ( $funcName, $args, $index0)
 Workalike for luaL_checknumber() More...
 
 checkString ( $funcName, $args, $index0)
 Workalike for luaL_checkstring() More...
 
 checkType ( $funcName, $args, $index0, $type, $msgType)
 Workalike for luaL_checktype() More...
 
 destroy ()
 
 executeFunctionChunk ( $chunk, $frame)
 Execute a module function chunk. More...
 
 executeModule ( $chunk, $functionName, $frame)
 Execute a module chunk in a new isolated environment, and return the specified function. More...
 
 expandTemplate ( $frameId, $titleText, $args)
 Handler for expandTemplate() More...
 
 frameExists ( $frameId)
 Handler for frameExists() More...
 
 getAllExpandedArguments ( $frameId)
 Handler for getAllExpandedArguments() More...
 
 getCodeEditorLanguage ()
 Get the language for Ace code editor. More...
 
 getExpandedArgument ( $frameId, $name)
 Handler for getExpandedArgument() More...
 
 getFrameTitle ( $frameId)
 Handler for getTitle() More...
 
 getGeSHiLanguage ()
 Get the language for GeSHi syntax highlighter. More...
 
 getInterpreter ()
 Get the current interpreter object. More...
 
 getLuaLibDir ()
 Return the base path for Lua modules. More...
 
 incrementExpensiveFunctionCount ()
 Increment the expensive function count, and throw if limit exceeded. More...
 
 isSubsting ()
 Return whether the parser is currently substing. More...
 
 loadPackage ( $name)
 Handler for the loadPackage() callback. More...
 
 loadPHPLibrary ( $name)
 Handler for the loadPHPLibrary() callback. More...
 
 newChildFrame ( $frameId, $title, array $args)
 Handler for newChildFrame() More...
 
 newLuaError ( $message, $params=[])
 
 preprocess ( $frameId, $text)
 Handler for preprocess() More...
 
 registerInterface ( $moduleFileName, $interfaceFuncs, $setupOptions=[])
 Register a Lua Library. More...
 
 runConsole (array $params)
 Run an interactive console request. More...
 
 setTTL ( $ttl)
 Handler for setTTL() More...
 
- 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. More...
 
 getDefaultExceptionParams ()
 
 getOption ( $optionName)
 Get an element from the configuration array. More...
 
 getParser ()
 
 getResourceUsage ( $resource)
 Get CPU and memory usage information, if the script engine provides it. More...
 
 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. More...
 

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

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. More...
 
static array $libraryPaths
 Paths for modules that may be loaded from Lua. More...
 

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. More...
 

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, Language\factory(), 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 $output, $status, getClockTick(), Scribunto_LuaEngine\getLogBuffer(), and load().

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: