On Tue, Feb 5, 2013 at 5:31 AM, Jens Ohlig <jens.oh...@wikimedia.de> wrote:
>
> Am 04.02.2013 um 18:03 schrieb Brad Jorsch <bjor...@wikimedia.org>:
>
>> On Mon, Feb 4, 2013 at 8:46 AM, Jens Ohlig <jens.oh...@wikimedia.de> wrote:
>>>
>>> Here are my questions:
>>> 1. 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.
>>
>> [1]: https://gerrit.wikimedia.org/r/#/c/47109/
>
> Thank you very much! This was EXACTLY the kind of answer I was hoping for. 
> Thank you very much for getting me unstuck \o/

Update: 47548 adds hooks for other extensions to add libraries,[2] and
47549 (which the above are already rebased on top of) reworks the unit
testing so other extensions can add Lua unit tests halfway sanely.[3]

 [2]: https://gerrit.wikimedia.org/r/#/c/47548/
 [3]: https://gerrit.wikimedia.org/r/#/c/47549/


-- 
Brad Jorsch
Software Engineer
Wikimedia Foundation

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to