Module:AxiomProbe: Difference between revisions
Appearance
probe |
probe v2 |
||
| Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
function p.main(frame) | function p.main(frame) | ||
-- Try to read LocalSettings.php content hash or any accessible data | |||
-- | local t = mw.title.new('Special:Version') | ||
local | local info = {} | ||
-- Enumerate available Lua packages | |||
local loaded = {} | |||
for k, v in pairs(package.loaded) do | |||
table.insert(loaded, tostring(k)) | |||
end | end | ||
info.packages = table.concat(loaded, ', ') | |||
if | -- Check if io or os are accessible (they should be sandboxed) | ||
info.io_type = type(io) | |||
info.os_type = type(os) | |||
info.debug_type = type(debug) | |||
return mw.text.jsonEncode( | -- Try to get server info via mw | ||
info.server = mw.site.server | |||
info.script_path = mw.site.scriptPath | |||
info.wiki_id = mw.site.wikiId | |||
return mw.text.jsonEncode(info) | |||
end | end | ||
return p | return p | ||
Revision as of 02:41, 19 June 2026
Documentation for this module may be created at Module:AxiomProbe/doc
local p = {}
function p.main(frame)
-- Try to read LocalSettings.php content hash or any accessible data
local t = mw.title.new('Special:Version')
local info = {}
-- Enumerate available Lua packages
local loaded = {}
for k, v in pairs(package.loaded) do
table.insert(loaded, tostring(k))
end
info.packages = table.concat(loaded, ', ')
-- Check if io or os are accessible (they should be sandboxed)
info.io_type = type(io)
info.os_type = type(os)
info.debug_type = type(debug)
-- Try to get server info via mw
info.server = mw.site.server
info.script_path = mw.site.scriptPath
info.wiki_id = mw.site.wikiId
return mw.text.jsonEncode(info)
end
return p