diff options
author | Natanael Copa <natanael.copa@gmail.com> | 2008-02-05 09:03:17 +0000 |
---|---|---|
committer | Natanael Copa <natanael.copa@gmail.com> | 2008-02-05 09:03:17 +0000 |
commit | 5bad3d11d108a242a57ea2df95eaa8482e129ead (patch) | |
tree | ac2d222c7032f02cf5369a0cdbdcc71207e6381a /lib | |
parent | 3857fee1017e8dec164faa13a0ca01828b4d50f6 (diff) | |
download | acf-core-5bad3d11d108a242a57ea2df95eaa8482e129ead.tar.bz2 acf-core-5bad3d11d108a242a57ea2df95eaa8482e129ead.tar.xz |
added a print_r() implementation
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@690 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib')
-rw-r--r-- | lib/debugs.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/debugs.lua b/lib/debugs.lua index 9ff9e9d..32eec7c 100644 --- a/lib/debugs.lua +++ b/lib/debugs.lua @@ -37,3 +37,15 @@ function variables ( view ) io.write( "<BR><BR>------------ END DEBUG INFORMATION ------------</span>") return end + + +-- from http://lua-users.org/wiki/MakingLuaLikePhp +function print_r (t, indent) -- alt version, abuse to http://richard.warburton.it + local indent=indent or '' + for key,value in pairs(t) do + io.write(indent,'[',tostring(key),']') + if type(value)=="table" then io.write(':\n') print_r(value,indent..'\t') + else io.write(' = ',tostring(value),'\n') end + end +end + |