18 May
2006
18 May
'06
6:01 a.m.
Rewrite module_invoke() like this (1 line change to call_user_func_array args): function module_invoke() { $args = func_get_args(); $module = array_shift($args); $hook = array_shift($args); $function = $module .'_'. $hook; if (module_hook($module, $hook)) { return call_user_func_array(array($module, $function), $args); } } Similar change to module_invoke_all()... And then wrap each module in a Class named same as module, as previously suggested. shazam! :-) Or rename everything to *_hook_* using a really smart global search and replace. Maybe a little AWK script could do it... hmmm.