Plugins EventManager during setup

  • Hi,


    previously there was a hook "afterFtpdBuildConf" that could be used in plugins. Is this way of modifying the config still something that can be done? Or should there be no plugin using the EventManager during setup?
    Still trying to figure out if the intended way is to have all plugins in the web interface and doing changes in for example the "enable" function. Is there any case where a hook during the setup would be needed?


    Sorry for the probably confusing question :)

  • Hello ;


    This event is still triggered but the plugins cannot act on service installers because they are loaded too late. However, a plugin can provide and install a hook files (merely called listener file in stable branch).


    The hook files are loaded in all contexts but you must be aware that on plugin installation, the hook file will no acts because the events from the proftpd installer are only triggered when the installer is run (either the imscp-autoinstall or imscp-setup script).

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • ok, so far it's clear. :)


    What would be a use case where a listener file is preferred over a plugin? I used such a listener file to change my proftpd config, so that during an update the changes are done again, however I think the same could be done in a plugin as well.

  • Re;


    This can be done by a plugin only if that plugin provide a hook file which will be installed in the hooks.d directory. For proftpd config change, it's totally useless to provide a plugin for such a thing. A simple hook file is largely sufficient.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • hmm, ok. So...


    simple changes where not much (or no changing) configuration is needed -> hook/listener files
    stuff with much configuration or changes done by users -> plugin


    hope I got it right. thx :)