Load hooks from directory (/etc/imscp/custom.d/*.pl)

  • Hello all,


    I was in need of a way to automatically include hooks when the engine is executed and I ended up with a very easy modification to achieve this.


    As suggested by Nuxwin in his thread (http://forum.i-mscp.net/Thread…0-rc1-4-and-newer-version) I've made sure that the HooksManager will load all the perl scripts in {CONF_DIR}/custom.d/ at initialization.


    No priorities support thought.


    To apply the patch:

    Code
    1. patch /var/www/imscp/engine/PerlLib/iMSCP/HooksManager.pm < HooksManager.pm.diff


    To remove the patch:

    Code
    1. patch -R /var/www/imscp/engine/PerlLib/iMSCP/HooksManager.pm < HooksManager.pm.diff


    Use at your own risk.



  • Hello ;


    Thanks you for your patch. I'll surely add it in our development branch ASAP. ;)

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

  • What is the current state of this, has it been integrated to master?

  • Yes, hooks are loaded from /etc/imscp/hooks.d/*.pl, plus the code is written better.

    Edited once, last by Zero ().