Do you want to know which modules are implementing a hook ?

Public

Info about which modules fires a hook is very handy, for example, if you working on improving performance - maybe there is a module which isn't necessary to be enable and you may disable it.

Edit: Thanks to @jaroslaw.kaminski for feedback :) I forgot " ' " at the end of line oO

Let's track hook_menu:

Get raw version
bash
  1. drush eval 'print_r(module_implements("menu"));'

There is a better way to do this found by @Drupby:

Get raw version
bash
  1. #Drush 5.9 has implemented two new commands:
  2. #List implementations of a given hook and explore source of specified one.
  3. drush fnh anyhook
  4. #Show the source of specified function or method.
  5. drush fnv

Comments

jaroslaw.kaminski's picture

1. you forgot about ' in end of your code.
2. Am I doing something wrong?

  1. <a href="mailto:bumfank@bumfank">bumfank@bumfank</a>-Latitude-E5420:~/corpo-site/corpo-site$ drush eval 'print_r(module_implements("menu"));'
  2.  
  3. Fatal error: Call to undefined function module_implements() in /usr/share/php/drush/commands/core/core.drush.inc(1040) : eval()'d code on line 1
  4. Drush command terminated abnormally due to an unrecoverable error. [error]
  5. Error: Call to undefined function module_implements() in /usr/share/php/drush/commands/core/core.drush.inc(1040) : eval()'d code, line 1
Limay's picture

It works for me:
drush eval 'print_r(module_implements("menu"));'

varvashenia's picture

fyi: code don't work in windows console (cmd).
on windows use Git Bash instead cmd.

drupby's picture

drush fnh menu
drush-7.x-5.9

drupby's picture

fn-hook (fnh, hook) List implementations of a given hook and explore source of specified one.
fn-view (fnv) Show the source of specified function or method.