diff mod_persisthosts/mod_persisthosts.lua @ 2447:366fadb5c6e5

mod_persisthosts: Fire an event to allow other modules a chance to write to the new config file
author Kim Alvefur <zash@zash.se>
date Wed, 18 Jan 2017 01:52:50 +0100
parents c563f4d64302
children
line wrap: on
line diff
--- a/mod_persisthosts/mod_persisthosts.lua	Wed Jan 18 01:38:17 2017 +0100
+++ b/mod_persisthosts/mod_persisthosts.lua	Wed Jan 18 01:52:50 2017 +0100
@@ -18,6 +18,7 @@
 			local fh, err = io.open(path, "w");
 			if fh then
 				fh:write(("VirtualHost%q\n"):format(host));
+				module:fire_event("host-persisted", { host = host, file = fh });
 				fh:close();
 				module:log("info", "Config file for host '%s' created", host);
 			else