MediaWiki REL1_34
|
Public Member Functions | |
__construct ( $engine, array $options) | |
__destruct () | |
callFunction ( $func,... $args) | |
Call a Lua function. | |
cleanupLuaChunks () | |
getStatus () | |
isLuaFunction ( $object) | |
Test whether an object is a Lua function. | |
loadString ( $text, $chunkName) | |
pauseUsageTimer () | |
Pause CPU usage and limits. | |
quit () | |
registerLibrary ( $name, array $functions) | |
Register a library of functions. | |
terminate () | |
testquit () | |
unpauseUsageTimer () | |
Unpause CPU usage and limits. | |
wrapPhpFunction ( $callable) | |
Wrap a PHP callable as a Lua function, which can be passed back into Lua. | |
Static Public Member Functions | |
static | getLuaVersion (array $options) |
Public Attributes | |
bool | $enableDebug |
Scribunto_LuaStandaloneEngine | $engine |
ScribuntoException | $exitError |
int | $id |
resource bool | $proc |
resource | $readPipe |
resource | $writePipe |
Protected Member Functions | |
callback ( $id, array $args) | |
checkValid () | |
debug ( $msg) | |
decodeHeader ( $header) | |
dispatch ( $msgToLua) | |
encodeLuaVar ( $var, $level=0) | |
encodeMessage ( $message) | |
handleCall ( $message) | |
handleError ( $message) | |
handleIOError () | |
receiveMessage () | |
sendMessage ( $msg) | |
Protected Attributes | |
callable[] | $callbacks |
LoggerInterface | $logger |
Static Protected Attributes | |
static | $nextInterpreterId = 0 |
Static Private Member Functions | |
static | fixNulls (array $array, $count) |
Fill in missing nulls in a list received from Lua. | |
Definition at line 120 of file LuaStandaloneEngine.php.
Scribunto_LuaStandaloneInterpreter::__construct | ( | $engine, | |
array | $options ) |
Scribunto_LuaStandaloneEngine | $engine | |
array | $options |
Definition at line 175 of file LuaStandaloneEngine.php.
References $engine, $path, wfEscapeShellArg(), and wfGetNull().
Scribunto_LuaStandaloneInterpreter::__destruct | ( | ) |
Definition at line 283 of file LuaStandaloneEngine.php.
References terminate().
|
protected |
Scribunto_LuaStandaloneInterpreter::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 358 of file LuaStandaloneEngine.php.
References $args, cleanupLuaChunks(), and dispatch().
|
protected |
ScribuntoException |
Definition at line 665 of file LuaStandaloneEngine.php.
References $exitError.
Referenced by handleIOError(), receiveMessage(), and sendMessage().
Scribunto_LuaStandaloneInterpreter::cleanupLuaChunks | ( | ) |
Definition at line 392 of file LuaStandaloneEngine.php.
References Scribunto_LuaStandaloneInterpreterFunction\$activeChunkIds, Scribunto_LuaStandaloneInterpreterFunction\$anyChunksDestroyed, and dispatch().
Referenced by callFunction(), and loadString().
|
protected |
Definition at line 723 of file LuaStandaloneEngine.php.
Referenced by receiveMessage(), and sendMessage().
|
protected |
Definition at line 648 of file LuaStandaloneEngine.php.
References $header.
Referenced by receiveMessage().
|
protected |
Definition at line 495 of file LuaStandaloneEngine.php.
References fixNulls(), handleCall(), handleError(), receiveMessage(), and sendMessage().
Referenced by callFunction(), cleanupLuaChunks(), getStatus(), loadString(), quit(), registerLibrary(), testquit(), and wrapPhpFunction().
|
protected |
mixed | $var | |
int | $level |
MWException |
Definition at line 577 of file LuaStandaloneEngine.php.
References $s, $type, and encodeLuaVar().
Referenced by encodeLuaVar(), and encodeMessage().
|
protected |
Definition at line 562 of file LuaStandaloneEngine.php.
References $serialized, and encodeLuaVar().
Referenced by sendMessage().
|
staticprivate |
Fill in missing nulls in a list received from Lua.
array | $array | List received from Lua |
int | $count | Number of values that should be in the list |
Definition at line 445 of file LuaStandaloneEngine.php.
Referenced by dispatch(), and handleCall().
|
static |
Definition at line 287 of file LuaStandaloneEngine.php.
References wfEscapeShellArg().
Referenced by Scribunto_LuaStandaloneEngine\getSoftwareInfo().
Scribunto_LuaStandaloneInterpreter::getStatus | ( | ) |
Definition at line 425 of file LuaStandaloneEngine.php.
References dispatch().
|
protected |
Definition at line 453 of file LuaStandaloneEngine.php.
References callback(), fixNulls(), and Scribunto_LuaError\getLuaMessage().
Referenced by dispatch().
|
protected |
Definition at line 482 of file LuaStandaloneEngine.php.
Referenced by dispatch().
|
protected |
ScribuntoException |
Definition at line 679 of file LuaStandaloneEngine.php.
References $exitError, and checkValid().
Referenced by receiveMessage(), and sendMessage().
Scribunto_LuaStandaloneInterpreter::isLuaFunction | ( | $object | ) |
Test whether an object is a Lua function.
object | $object |
Reimplemented from Scribunto_LuaInterpreter.
Definition at line 402 of file LuaStandaloneEngine.php.
Scribunto_LuaStandaloneInterpreter::loadString | ( | $text, | |
$chunkName ) |
string | $text | |
string | $chunkName |
Reimplemented from Scribunto_LuaInterpreter.
Definition at line 347 of file LuaStandaloneEngine.php.
References cleanupLuaChunks(), and dispatch().
Scribunto_LuaStandaloneInterpreter::pauseUsageTimer | ( | ) |
Pause CPU usage and limits.
Reimplemented from Scribunto_LuaInterpreter.
Definition at line 432 of file LuaStandaloneEngine.php.
Scribunto_LuaStandaloneInterpreter::quit | ( | ) |
Definition at line 326 of file LuaStandaloneEngine.php.
References dispatch().
|
protected |
Definition at line 530 of file LuaStandaloneEngine.php.
References $header, checkValid(), debug(), decodeHeader(), handleIOError(), and unserialize().
Referenced by dispatch().
Scribunto_LuaStandaloneInterpreter::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 406 of file LuaStandaloneEngine.php.
References $id, and dispatch().
|
protected |
Definition at line 517 of file LuaStandaloneEngine.php.
References checkValid(), debug(), encodeMessage(), and handleIOError().
Referenced by dispatch().
Scribunto_LuaStandaloneInterpreter::terminate | ( | ) |
Definition at line 317 of file LuaStandaloneEngine.php.
Referenced by __destruct().
Scribunto_LuaStandaloneInterpreter::testquit | ( | ) |
Definition at line 334 of file LuaStandaloneEngine.php.
References dispatch().
Scribunto_LuaStandaloneInterpreter::unpauseUsageTimer | ( | ) |
Unpause CPU usage and limits.
Reimplemented from Scribunto_LuaInterpreter.
Definition at line 435 of file LuaStandaloneEngine.php.
Scribunto_LuaStandaloneInterpreter::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 381 of file LuaStandaloneEngine.php.
References $id, and dispatch().
|
protected |
Definition at line 166 of file LuaStandaloneEngine.php.
bool Scribunto_LuaStandaloneInterpreter::$enableDebug |
Definition at line 131 of file LuaStandaloneEngine.php.
Scribunto_LuaStandaloneEngine Scribunto_LuaStandaloneInterpreter::$engine |
Definition at line 126 of file LuaStandaloneEngine.php.
Referenced by __construct().
ScribuntoException Scribunto_LuaStandaloneInterpreter::$exitError |
Definition at line 151 of file LuaStandaloneEngine.php.
Referenced by checkValid(), and handleIOError().
int Scribunto_LuaStandaloneInterpreter::$id |
Definition at line 156 of file LuaStandaloneEngine.php.
Referenced by callback(), registerLibrary(), and wrapPhpFunction().
|
protected |
Definition at line 161 of file LuaStandaloneEngine.php.
|
staticprotected |
Definition at line 121 of file LuaStandaloneEngine.php.
resource bool Scribunto_LuaStandaloneInterpreter::$proc |
Definition at line 136 of file LuaStandaloneEngine.php.
resource Scribunto_LuaStandaloneInterpreter::$readPipe |
Definition at line 146 of file LuaStandaloneEngine.php.
resource Scribunto_LuaStandaloneInterpreter::$writePipe |
Definition at line 141 of file LuaStandaloneEngine.php.