On Wed, Jun 25, 2008 at 6:14 PM, Aaron Winborn <<a href="mailto:winborn@advomatic.com">winborn@advomatic.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
mymod.module<br>
$mymod_bar = module_call('optionalmod', 'cool_function', $args);<br>
if (isset($mymod_bar)) {<br>
$mymod_foo = module_invoke('urmod', 'some_hook', $mymod_bar);<br><div><div class="Wj3C7c">
}<br>
</div></div></blockquote></div><br>Again, I do not see the point of module_call if you can do:<br><br>if (drupal_function_exists('cool_function')) {<br> $mymod_bar = cool_function($args);<br>}<br><br>Advantages?<br>
- It is cleaner and faster<br>- It does not add a new level of indirection<br>- It makes reference tracking works (such as what is done on <a href="http://api.drupal.org">api.drupal.org</a>)<br><br>Moreover, you can do correct error management:<br>
<br>if (drupal_function_exists()) {<br>}<br>else {<br>}<br><br>Damien<br><br>