MediaWiki
1.34.0
|
Public Member Functions | |
__construct ( $engine, array $options) | |
callFunction ( $func,... $args) | |
Call a Lua function. More... | |
getCPUUsage () | |
getPeakMemoryUsage () | |
getProfilerFunctionReport ( $units) | |
isLuaFunction ( $object) | |
Test whether an object is a Lua function. More... | |
loadString ( $text, $chunkName) | |
pauseUsageTimer () | |
Pause CPU usage and limits. More... | |
registerLibrary ( $name, array $functions) | |
Register a library of functions. More... | |
unpauseUsageTimer () | |
Unpause CPU usage and limits. More... | |
wrapPhpFunction ( $callable) | |
Wrap a PHP callable as a Lua function, which can be passed back into Lua. More... | |
Static Public Member Functions | |
static | checkLuaSandboxVersion () |
Check that php-luasandbox is available and of a recent-enough version. More... | |
Public Attributes | |
Scribunto_LuaEngine | $engine |
bool | $profilerEnabled |
LuaSandbox | $sandbox |
const | PERCENT = 2 |
const | SAMPLES = 0 |
const | SECONDS = 1 |
Protected Member Functions | |
convertSandboxError (LuaSandboxError $e) | |
Definition at line 215 of file Engine.php.
Scribunto_LuaSandboxInterpreter::__construct | ( | $engine, | |
array | $options | ||
) |
Definition at line 254 of file Engine.php.
References $engine, and checkLuaSandboxVersion().
Scribunto_LuaSandboxInterpreter::callFunction | ( | $func, | |
$args | |||
) |
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 from Scribunto_LuaInterpreter.
Definition at line 312 of file Engine.php.
References $args, and convertSandboxError().
|
static |
Check that php-luasandbox is available and of a recent-enough version.
Definition at line 240 of file Engine.php.
Referenced by __construct(), Scribunto_LuaSandboxEngine\getSoftwareInfo(), and Scribunto_LuaEngine\newAutodetectEngine().
|
protected |
Definition at line 270 of file Engine.php.
Referenced by callFunction(), and loadString().
Scribunto_LuaSandboxInterpreter::getCPUUsage | ( | ) |
Definition at line 342 of file Engine.php.
Scribunto_LuaSandboxInterpreter::getPeakMemoryUsage | ( | ) |
Definition at line 338 of file Engine.php.
Scribunto_LuaSandboxInterpreter::getProfilerFunctionReport | ( | $units | ) |
Definition at line 346 of file Engine.php.
Scribunto_LuaSandboxInterpreter::isLuaFunction | ( | $object | ) |
Test whether an object is a Lua function.
object | $object |
Reimplemented from Scribunto_LuaInterpreter.
Definition at line 334 of file Engine.php.
Scribunto_LuaSandboxInterpreter::loadString | ( | $text, | |
$chunkName | |||
) |
string | $text | |
string | $chunkName |
Scribunto_LuaError |
Reimplemented from Scribunto_LuaInterpreter.
Definition at line 290 of file Engine.php.
References convertSandboxError().
Scribunto_LuaSandboxInterpreter::pauseUsageTimer | ( | ) |
Pause CPU usage and limits.
Reimplemented from Scribunto_LuaInterpreter.
Definition at line 362 of file Engine.php.
Scribunto_LuaSandboxInterpreter::registerLibrary | ( | $name, | |
array | $functions | ||
) |
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 from Scribunto_LuaInterpreter.
Definition at line 298 of file Engine.php.
Scribunto_LuaSandboxInterpreter::unpauseUsageTimer | ( | ) |
Unpause CPU usage and limits.
Reimplemented from Scribunto_LuaInterpreter.
Definition at line 366 of file Engine.php.
Scribunto_LuaSandboxInterpreter::wrapPhpFunction | ( | $callable | ) |
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 from Scribunto_LuaInterpreter.
Definition at line 330 of file Engine.php.
Scribunto_LuaEngine Scribunto_LuaSandboxInterpreter::$engine |
Definition at line 219 of file Engine.php.
Referenced by __construct().
bool Scribunto_LuaSandboxInterpreter::$profilerEnabled |
Definition at line 229 of file Engine.php.
LuaSandbox Scribunto_LuaSandboxInterpreter::$sandbox |
Definition at line 224 of file Engine.php.
const Scribunto_LuaSandboxInterpreter::PERCENT = 2 |
Definition at line 233 of file Engine.php.
Referenced by Scribunto_LuaSandboxEngine\getLimitReportData().
const Scribunto_LuaSandboxInterpreter::SAMPLES = 0 |
Definition at line 231 of file Engine.php.
const Scribunto_LuaSandboxInterpreter::SECONDS = 1 |
Definition at line 232 of file Engine.php.
Referenced by Scribunto_LuaSandboxEngine\getLimitReportData().