core/moduleapi.lua
changeset 7144 362545c3f8bb
parent 7119 ecba5fee4867
parent 7130 27557dd7b460
child 7145 67226eaef97c
equal deleted inserted replaced
7129:de3659191e90 7144:362545c3f8bb
   301 	end
   301 	end
   302 	value:include(global_value);
   302 	value:include(global_value);
   303 	return value;
   303 	return value;
   304 end
   304 end
   305 
   305 
       
   306 function api:get_option_path(name, default, parent)
       
   307 	if parent == nil then
       
   308 		parent = parent or self:get_directory();
       
   309 	elseif prosody.paths[parent] then
       
   310 		parent = prosody.paths[parent];
       
   311 	end
       
   312 	local value = self:get_option_string(name, default);
       
   313 	if value == nil then
       
   314 		return nil;
       
   315 	end
       
   316 	return resolve_relative_path(parent, value);
       
   317 end
       
   318 
       
   319 
   306 function api:context(host)
   320 function api:context(host)
   307 	return setmetatable({host=host or "*"}, {__index=self,__newindex=self});
   321 	return setmetatable({host=host or "*"}, {__index=self,__newindex=self});
   308 end
   322 end
   309 
   323 
   310 function api:add_item(key, value)
   324 function api:add_item(key, value)