Module:Sandbox/Ahecht/sandbox: Difference between revisions

Content deleted Content added
update
simplify
 
(3 intermediate revisions by the same user not shown)
Line 6:
 
function p.main(frame)
local nameSpacesmwSite = ''
for k,v in pairs(mw.site) do
local siteStats = ''
mwSite = mwSite .. '\n*mw.site.' .. k .. ': '
for k,v in pairs(mw.site.stats) do if type(v) ~= 'function' then siteStats = siteStats .. '\n**' .. k .. ': ' .. v end end
if type(v) == 'string' or type(v) == 'number' then
local output = '*Version: ' .. mw.site.currentVersion .. '\n*$wgScriptPath: ' .. mw.site.scriptPath .. '\n*$wgServer: ' .. mw.site.server .. '\n*$wgSitename: ' .. mw.site.siteName .. '\n*$wgStylePath: ' .. mw.site.stylePath .. '\n*mw.site.stats: ' .. siteStats
mwSite = mwSite .. v
return output
elseif type(v) == 'table' then
for kkk,vvv in pairs(mw.site.statsv) do if type(vvv) ~== 'string' or type(vv) == 'functionnumber' then siteStatsmwSite = siteStatsmwSite .. '\n**mw.site.' .. k .. '.' .. kk .. ': ' .. v vv end end
end
end
return outputmwSite
end