File

plugins/sql.lib.lua @ 7051:ecfa474ff570

tests/test.lua: Fix fake module() function to prevent _M from being _G (test.lua's environment), which caused modules to break the sandbox when they set _M.*
author Matthew Wild <mwild1@gmail.com>
date Wed, 06 Jan 2016 00:24:06 +0000
parent 5494:9916f0a2d178
line wrap: on
line source

local cache = module:shared("/*/sql.lib/util.sql");

if not cache._M then
	prosody.unlock_globals();
	cache._M = require "util.sql";
	prosody.lock_globals();
end

return cache._M;