Bryan Tong Minh wrote:
Indeed. I first tried something along those lines, but I got a stuck because the hooks may change the function to be called
That is fine. Just pass $this->mFunction directly to the hook, there is no need to make a $func copy as it is now.
and because I was not sure whether the require_once in execute() would result the wfSpecialFunction to be in local or global variable scope.
Functions declared inside other functions (or methods) in PHP are global, so it is ok.
See the patch attached, I just tested and it works.