util/startup.lua
changeset 12785 22066b02887f
parent 12783 f0474d40364c
child 12786 8815d3090928
equal deleted inserted replaced
12784:2c0c1b18a02b 12785:22066b02887f
   275 	prosody.log = logger.init("general");
   275 	prosody.log = logger.init("general");
   276 
   276 
   277 	startup.detect_platform();
   277 	startup.detect_platform();
   278 	startup.detect_installed();
   278 	startup.detect_installed();
   279 	_G.prosody = prosody;
   279 	_G.prosody = prosody;
       
   280 
       
   281 	-- COMPAT Lua < 5.3
       
   282 	if not math.type then
       
   283 		-- luacheck: ignore 122/math
       
   284 		function math.type(n)
       
   285 			if type(n) == "number" then
       
   286 				if n % 1 == 0 and (n + 1 ~= n and n - 1 ~= n) then
       
   287 					return "integer"
       
   288 				else
       
   289 					return "float"
       
   290 				end
       
   291 			end
       
   292 		end
       
   293 	end
   280 end
   294 end
   281 
   295 
   282 function startup.setup_datadir()
   296 function startup.setup_datadir()
   283 	prosody.paths.data = config.get("*", "data_path") or CFG_DATADIR or "data";
   297 	prosody.paths.data = config.get("*", "data_path") or CFG_DATADIR or "data";
   284 end
   298 end