This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

How can I Overwrite Default Hook?
#1
How can I Overwrite Default Hook?
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?
My Sentora Resources
[Module] Mail Quota Count | Vagrant Box with Sentora

[Image: vanguardly-logo-micro.png]
Graphic and Web Design. Development.
www.vanguardly.com


Reply
Thanks given by:
#2
RE: How can I Overwrite Default Hook?
Nope currently. I don't see any way.

Unless you change the main module it self.
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

10$ free to start your VPS
Reply
Thanks given by:
#3
RE: How can I Overwrite Default Hook?
Thank you.
I think thats might be the only option Smile
My Sentora Resources
[Module] Mail Quota Count | Vagrant Box with Sentora

[Image: vanguardly-logo-micro.png]
Graphic and Web Design. Development.
www.vanguardly.com


Reply
Thanks given by:
#4
RE: How can I Overwrite Default Hook?
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
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

10$ free to start your VPS
Reply
Thanks given by:
#5
RE: How can I Overwrite Default Hook?
Why not use something like the WordPRess filters?
http://dev.themeblvd.com/tutorial/filters/

I do honestly believe this is a clean solution.
My Sentora Resources
[Module] Mail Quota Count | Vagrant Box with Sentora

[Image: vanguardly-logo-micro.png]
Graphic and Web Design. Development.
www.vanguardly.com


Reply
Thanks given by:
#6
RE: How can I Overwrite Default Hook?
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...
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

10$ free to start your VPS
Reply
Thanks given by:
#7
RE: How can I Overwrite Default Hook?
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.
My Sentora Resources
[Module] Mail Quota Count | Vagrant Box with Sentora

[Image: vanguardly-logo-micro.png]
Graphic and Web Design. Development.
www.vanguardly.com


Reply
Thanks given by:
#8
RE: How can I Overwrite Default Hook?
May be later once apache_admin module get the revamp it deserves.
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

10$ free to start your VPS
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
Default login page redirect. blakethepatton 3 11 ,637 01-31-2016, 09:47 AM
Last Post: blakethepatton

Forum Jump:


Users browsing this thread: 1 Guest(s)