You are here

function module_builder_callback_hook_analyze in Module Builder 6.2

Callback to list hook implementations found in a given module.

1 string reference to 'module_builder_callback_hook_analyze'
module_builder_drush_command in drush/module_builder.drush.inc
Implementation of hook_drush_command().

File

drush/module_builder.drush.inc, line 596
Module builder drush commands.

Code

function module_builder_callback_hook_analyze() {
  $commands = func_get_args();

  // The first argument is the module machine name.
  $module_root_name = array_shift($commands);

  // Include process component file.
  module_builder_include('process');
  $hooks = module_builder_get_hook_names(_module_builder_get_hooks_directory(), TRUE);
  foreach ($hooks as $key => $hook) {
    $hooks[$key] = $module_root_name . '_' . $hook;
  }
  $module_files = module_builder_get_module_files($module_root_name);

  //drush_print_r($module_files);
  foreach ($module_files as $file) {
    $functions = module_builder_get_functions($file);
    $module_hooks[$file] = array_intersect($functions, $hooks);
  }
  if (drush_get_option('flat')) {
  }
  drush_print_r($module_hooks);
  drush_print_r(array_merge($module_hooks));
}