Software /
code /
prosody
Comparison
plugins/mod_console.lua @ 712:56410c0cd846
mod_console: Added module:reload
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 13 Jan 2009 22:39:07 +0500 |
parent | 669:9255abbb3068 |
child | 736:7cbae2d16fd6 |
comparison
equal
deleted
inserted
replaced
711:7653519ec4f2 | 712:56410c0cd846 |
---|---|
167 return false, err or "Unknown error unloading module"; | 167 return false, err or "Unknown error unloading module"; |
168 end | 168 end |
169 return true, "Module unloaded"; | 169 return true, "Module unloaded"; |
170 end | 170 end |
171 | 171 |
172 function def_env.module:reload(name, host) | |
173 local mm = require "modulemanager"; | |
174 local ok, err = mm.reload(host or self.env.host, name); | |
175 if not ok then | |
176 return false, err or "Unknown error reloading module"; | |
177 end | |
178 return true, "Module reloaded"; | |
179 end | |
180 | |
172 def_env.config = {}; | 181 def_env.config = {}; |
173 function def_env.config:load(filename, format) | 182 function def_env.config:load(filename, format) |
174 local config_load = require "core.configmanager".load; | 183 local config_load = require "core.configmanager".load; |
175 local ok, err = config_load(filename, format); | 184 local ok, err = config_load(filename, format); |
176 if not ok then | 185 if not ok then |