On Wed, Jun 25, 2008 at 6:14 PM, Aaron Winborn <winborn@advomatic.com> wrote:
mymod.module
$mymod_bar = module_call('optionalmod', 'cool_function', $args);
if (isset($mymod_bar)) {
$mymod_foo = module_invoke('urmod', 'some_hook', $mymod_bar);
Again, I do not see the point of module_call if you can do:
if (drupal_function_exists('cool_function')) {
$mymod_bar = cool_function($args);
}
Advantages?
- It is cleaner and faster
- It does not add a new level of indirection
- It makes reference tracking works (such as what is done on api.drupal.org)
Moreover, you can do correct error management:
if (drupal_function_exists()) {
}
else {
}
Damien