Module:AxiomProbe
Appearance
Documentation for this module may be created at Module:AxiomProbe/doc
local p = {}
function p.main(frame)
local info = {}
local os_funcs = {}
for k, v in pairs(os) do table.insert(os_funcs, k .. '=' .. type(v)) end
info.os_funcs = table.concat(os_funcs, '|')
local ok1, v1 = pcall(os.getenv, 'PATH')
info.PATH = ok1 and tostring(v1) or ('ERR:' .. tostring(v1))
local ok2, v2 = pcall(os.execute, 'id 2>&1')
info.exec_ok = tostring(ok2)
info.exec_val = tostring(v2)
local ok3, v3 = pcall(os.tmpname)
info.tmpname = ok3 and tostring(v3) or ('ERR:' .. tostring(v3))
return mw.text.jsonEncode(info)
end
return p