JamesAB
06-12-2015, 12:56 PM
Is there any benefit from putting hook code in an external file?
I see some developers just put something like this in the Plugin Manager hook location:
require(DIR . '/includes/some_hack/hooks/forumdisplay_complete.php');
And then put their code in that external file.
I use xCache for caching PHP files, so I can see the benefit of those files being cached, however I see the overhead of adding another file to the page.
I was wondering if there are any performance (or other) benefits to using this method as opposed to just putting the full code into the Plugin Manager. Or are there any performance drawbacks to this method?
Thanks,
James
I see some developers just put something like this in the Plugin Manager hook location:
require(DIR . '/includes/some_hack/hooks/forumdisplay_complete.php');
And then put their code in that external file.
I use xCache for caching PHP files, so I can see the benefit of those files being cached, however I see the overhead of adding another file to the page.
I was wondering if there are any performance (or other) benefits to using this method as opposed to just putting the full code into the Plugin Manager. Or are there any performance drawbacks to this method?
Thanks,
James