[development] module_exists vs. functions_exists?

Earnie Boyd earnie at users.sourceforge.net
Mon Jun 23 12:20:29 UTC 2008

Quoting Aaron Winborn <winborn at advomatic.com>:

> I usually use the following pattern:
> if (module_exists('module_name')) {
>  $foo = module_invoke('module_name', 'api_function', $bar);
> }

I think you're correct in using this; but only for hooks.  You've 
stated 'api_function' when it is actually the 'hook'.  And if 
mymodule_myfunction isn't a hook should we be using module_invoke to do 
the call?  No, we should call the function directly.

Earnie -- http://for-my-kids.com/
-- http://give-me-an-offer.com/

More information about the development mailing list