mod_persisthosts: Fire an event to allow other modules a chance to write to the new config file
authorKim Alvefur <zash@zash.se>
Wed, 18 Jan 2017 01:52:50 +0100
changeset 2451 366fadb5c6e5
parent 2450 c563f4d64302
child 2452 1f7f66272f73
mod_persisthosts: Fire an event to allow other modules a chance to write to the new config file
mod_persisthosts/mod_persisthosts.lua
--- 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