Tim Starling has submitted this change and it was merged.

Change subject: Add Scribunto_LuaInterpreter::wrapPhpFunction
......................................................................


Add Scribunto_LuaInterpreter::wrapPhpFunction

Currently, the only way for PHP to pass a function to Lua is to pass
back a function that it received from Lua. This means, for example, that
PHP cannot implement a Lua iterator function except by registering a
library holding the function or by using loadString.

This changeset adds Scribunto_LuaInterpreter::wrapPhpFunction (and
implements it for both LuaSandbox and LuaStandalone), which takes a PHP
callable and returns a Lua function wrapping it.

Note that fallback code is included so this does not depend on
I2e552799.

Change-Id: Ic0a98eec7cc17ef4b1acee032c0f42d617b998d2
---
M engines/LuaCommon/LuaInterpreter.php
M engines/LuaSandbox/Engine.php
M engines/LuaStandalone/LuaStandaloneEngine.php
M engines/LuaStandalone/MWServer.lua
M tests/engines/LuaCommon/LuaInterpreterTest.php
5 files changed, 78 insertions(+), 0 deletions(-)

Approvals:
  Tim Starling: Verified; Looks good to me, approved


--
To view, visit https://gerrit.wikimedia.org/r/38622
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic0a98eec7cc17ef4b1acee032c0f42d617b998d2
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Scribunto
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Demon <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: Victor Vasiliev <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to