MediaWiki REL1_34
|
Public Member Functions | |
callFunction ( $func,... $args) | |
Call a Lua function. | |
isLuaFunction ( $object) | |
Test whether an object is a Lua function. | |
loadString ( $text, $chunkName) | |
Load a string. | |
pauseUsageTimer () | |
Pause CPU usage and limits. | |
registerLibrary ( $name, array $functions) | |
Register a library of functions. | |
unpauseUsageTimer () | |
Unpause CPU usage and limits. | |
wrapPhpFunction ( $callable) | |
Wrap a PHP callable as a Lua function, which can be passed back into Lua. | |
Definition at line 3 of file LuaInterpreter.php.
|
abstract |
Call a Lua function.
Return an array of results, with indices starting at zero. If an error occurs, a Scribunto_LuaError will be thrown.
mixed | $func | The function object |
mixed | ...$args Arguments to the function |
Reimplemented in Scribunto_LuaSandboxInterpreter, and Scribunto_LuaStandaloneInterpreter.
|
abstract |
Test whether an object is a Lua function.
object | $object |
Reimplemented in Scribunto_LuaSandboxInterpreter, and Scribunto_LuaStandaloneInterpreter.
|
abstract |
Load a string.
Return an object which can later be passed to callFunction. If there is a pass error, a Scribunto_LuaError will be thrown.
string | $text | The Lua source code |
string | $chunkName | The chunk name |
Reimplemented in Scribunto_LuaSandboxInterpreter, and Scribunto_LuaStandaloneInterpreter.
|
abstract |
Pause CPU usage and limits.
Reimplemented in Scribunto_LuaSandboxInterpreter, and Scribunto_LuaStandaloneInterpreter.
|
abstract |
Register a library of functions.
string | $name | The global variable name to be created or added to. |
array | $functions | An associative array mapping the function name to the callback. The callback may throw a Scribunto_LuaError, which will be caught and raised in the Lua code as a Lua error, catchable with pcall(). |
Reimplemented in Scribunto_LuaSandboxInterpreter, and Scribunto_LuaStandaloneInterpreter.
|
abstract |
Unpause CPU usage and limits.
Reimplemented in Scribunto_LuaSandboxInterpreter, and Scribunto_LuaStandaloneInterpreter.
|
abstract |
Wrap a PHP callable as a Lua function, which can be passed back into Lua.
If an error occurs, a Scribunto_LuaError will be thrown.
callable | $callable | The PHP callable |
Reimplemented in Scribunto_LuaSandboxInterpreter, and Scribunto_LuaStandaloneInterpreter.