mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-12-25 06:13:08 +00:00
31 lines
475 B
Lua
31 lines
475 B
Lua
|
local p = {}
|
||
|
local php
|
||
|
local options
|
||
|
|
||
|
function p.setupInterface( opts )
|
||
|
-- Boilerplate
|
||
|
p.setupInterface = nil
|
||
|
php = mw_interface
|
||
|
mw_interface = nil
|
||
|
options = opts
|
||
|
|
||
|
-- Loaded dynamically, don't mess with globals like 'mw' or
|
||
|
-- 'package.loaded'
|
||
|
end
|
||
|
|
||
|
function p.test()
|
||
|
return options.test, php.test()
|
||
|
end
|
||
|
|
||
|
function p.setVal( frame )
|
||
|
options.val = frame.args[1]
|
||
|
end
|
||
|
|
||
|
function p.getVal( frame )
|
||
|
return tostring( options.val )
|
||
|
end
|
||
|
|
||
|
p.foobar = { val = "nope" }
|
||
|
|
||
|
return p
|