diff options
author | David Phillips <david@sighup.nz> | 2018-09-21 21:50:50 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2018-09-21 21:50:50 +1200 |
commit | 47b4448199799aca7c0fb3e0090e244112c8959c (patch) | |
tree | b79469ab87678500fe17af796a144042d2edcfa0 /Plugin.pm | |
parent | b65441dbdb62e575fbb69580342e50079c871d18 (diff) | |
download | idalius-47b4448199799aca7c0fb3e0090e244112c8959c.tar.xz |
Move module configuration to callback
This lets modules loaded dynamically (i.e. those not specified in configuation
used at the start of execution) get configured correctly to e.g. record
a reference to their configuration and register commands.
Diffstat (limited to 'Plugin.pm')
-rw-r--r-- | Plugin.pm | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -3,7 +3,11 @@ package Plugin; use strict; use warnings; -my $unload_callback; +my $load_callback; + +sub set_load_callback { + ($load_callback) = @_; +}; sub load_plugin { my ($logger, $config, $module) = @_; @@ -19,6 +23,7 @@ sub load_plugin { $logger->($@); return "Cannot load $module: $!"; }; + $load_callback->($module); return undef; } |