Sentora Support Forums

Full Version: How can I Overwrite Default Hook?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Greetings,
Developing a Sentora Module is there any way to overwrite a default hook?
For example I would like to change the way the OnEndDaemonRun hook works, is this possible via a module?
Nope currently. I don't see any way.

Unless you change the main module it self.
Thank you.
I think thats might be the only option Smile
The issue will be when the panel get an update your modifications will be overwritten.

We had a discussion about this and we still don't have a clean solutions for mods to the core files.

M B
Why not use something like the WordPRess filters?
http://dev.themeblvd.com/tutorial/filters/

I do honestly believe this is a clean solution.
Hmm but hooks are different way from this functions you call in themes...

Don't forget you may need to add a mod in any line.... and even if you call an external override for the function. the original function may change in upgrades...
I understand that and I agree that it would be ideal to add a mod on any line, however that is simply not needed and having something working in a simple way is better than not having it at all.

Although I understand themes are different, the concept the same (also filters are not necessarily used in themes but also in plugins.

Regarding future updates breaking the code... Well that's a issue I can live with and I'm sure everyone who codes addons/plugins/modules will agree with me that it is simply not possible to have the code 100% upgrade safe when you are changing how core things wok.

The main use case for this would be to allow for very specific use cases where the user might need to tweak things for his/her particular use case.

Also, as long as the Sentora changelog provides information about what filters/hooks were changed it shall be rather simple to keep things flowing.

Just my opinion and its all theory I admit that in practice it might not be this easy, but we need to start from some place.
May be later once apache_admin module get the revamp it deserves.