Check for module_exists()!

I know you follow the best practices, test your code, live healthy...

But sometimes something goes wrong...

Do you check whether the module has been enabled before you use one so useful function included in it?

Okay, you can do it easily:

  1. <?php
  2. if(module_exists('useful_core_module')){
  3. //you can call functions from the module now...
  4. }
  5. ?>

  • Drupal Modules: