Software /
code /
prosody
Comparison
core/moduleapi.lua @ 8993:bd9b67f742c9
moduleapi: Lazy-load configmanager on demand simplify dependency graph
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 07 Jul 2018 21:55:00 +0200 |
parent | 8533:66cdf5c7af85 |
child | 8994:f17e768c1a99 |
comparison
equal
deleted
inserted
replaced
8992:972b6f793ff9 | 8993:bd9b67f742c9 |
---|---|
4 -- | 4 -- |
5 -- This project is MIT/X11 licensed. Please see the | 5 -- This project is MIT/X11 licensed. Please see the |
6 -- COPYING file in the source package for more information. | 6 -- COPYING file in the source package for more information. |
7 -- | 7 -- |
8 | 8 |
9 local config = require "core.configmanager"; | |
10 local array = require "util.array"; | 9 local array = require "util.array"; |
11 local set = require "util.set"; | 10 local set = require "util.set"; |
12 local it = require "util.iterators"; | 11 local it = require "util.iterators"; |
13 local logger = require "util.logger"; | 12 local logger = require "util.logger"; |
14 local pluginloader = require "util.pluginloader"; | 13 local pluginloader = require "util.pluginloader"; |
194 end | 193 end |
195 return unpack(data_array); | 194 return unpack(data_array); |
196 end | 195 end |
197 | 196 |
198 function api:get_option(name, default_value) | 197 function api:get_option(name, default_value) |
198 local config = require "core.configmanager"; | |
199 local value = config.get(self.host, name); | 199 local value = config.get(self.host, name); |
200 if value == nil then | 200 if value == nil then |
201 value = default_value; | 201 value = default_value; |
202 end | 202 end |
203 return value; | 203 return value; |