The Devel
module (https://www.drupal.org/project/devel) has a couple of commands that are extremely useful when either looking for hook implementations or locating functions within a Drupal installation. We will see them in action in the following sections.
The fn-
hook
command lists all modules implementing a given hook name. This command comes in very handy when you want to implement a hook, but want to check before whether any other modules implement it and what do they do.
Let's take hook_cron()
as an example. In Chapter 3, Running and Monitoring Tasks in Drupal Projects, we spoke about the importance of extracting some tasks out of hook_cron()
and moved them into a custom Drush command so that they could run on their own process and scheduling. Let's go to our sample Drupal project and run the command to see which modules implement hook_cron()
. We will assume that the Devel
module is already downloaded...