[development] when we run out of characters

Chris Johnson chris at tinpixel.com
Thu May 18 04:01:50 UTC 2006


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.



More information about the development mailing list