Revert "Change. Use require "resources.functions.config" to load config file."
This commit is contained in:
@@ -23,8 +23,16 @@
|
||||
-- Mark J Crane <markjcrane@fusionpbx.com>
|
||||
-- Errol Samuels <voiptology@gmail.com>
|
||||
|
||||
--define the explode function
|
||||
require "resources.functions.explode";
|
||||
--define explode
|
||||
function explode ( seperator, str )
|
||||
local pos, arr = 0, {}
|
||||
for st, sp in function() return string.find( str, seperator, pos, true ) end do -- for each divider found
|
||||
table.insert( arr, string.sub( str, pos, st-1 ) ) -- attach chars left of current divider
|
||||
pos = sp + 1 -- jump past current divider
|
||||
end
|
||||
table.insert( arr, string.sub( str, pos ) ) -- attach chars right of last divider
|
||||
return arr
|
||||
end
|
||||
|
||||
--usage
|
||||
--luarun app.lua event_notify internal reboot 1003@domain.fusionpbx.com yealink
|
||||
|
||||
Reference in New Issue
Block a user