PHP Classes

File: tests/WebPower/LuaSandbox/Tests/dumpGlobals.lua

Recommend this page to a friend!
  Classes of Christiaan Baartse   Lua sandbox   tests/WebPower/LuaSandbox/Tests/dumpGlobals.lua   Download  
File: tests/WebPower/LuaSandbox/Tests/dumpGlobals.lua
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Lua sandbox
Run Lua language code integrated with PHP code
Author: By
Last change: Update of tests/WebPower/LuaSandbox/Tests/dumpGlobals.lua
Date: 1 year ago
Size: 468 bytes


Class file image Download
local seen = {} function dumpGlobals(t, prefix) seen[t] = true local names = {} for name in pairs(t) do table.insert(names, prefix .. name) local v = t[name] if type(v)=="table" and not seen[v] then local sub = dumpGlobals(v, prefix .. name .. '.') for sub_k,sub_v in pairs(sub) do table.insert(names, sub_v) end end end return names end return dumpGlobals(_G, '')