Am 04.02.2013 um 18:03 schrieb Brad Jorsch bjorsch@wikimedia.org:
On Mon, Feb 4, 2013 at 8:46 AM, Jens Ohlig jens.ohlig@wikimedia.de wrote:
Here are my questions:
- Is there an easy way to add your own Lua functions (that call PHP Api functions) to Scribunto other than writing them into LuaCommon.php?
Yes. Probably the best example to look at right now is gerrit change 47109.[1] You could also look at 42050, 38013, or 46478. Keep in mind that any functions you provide have the at least same sorts of security and performance concerns as parser function hooks.
The major issue right now is that there's no way to add something to Scribunto_LuaEngine::$libraryClasses from another extension. There's also the issue of easily adding unit tests from another extension, since ideally the unit tests should be run against both the LuaStandalone and LuaSandbox engines. I'll probably have a look at this today.
Thank you very much! This was EXACTLY the kind of answer I was hoping for. Thank you very much for getting me unstuck \o/