function drush_command_invoke_all_ref

8.0.x command.inc drush_command_invoke_all_ref($hook, &$reference_parameter)
6.x command.inc drush_command_invoke_all_ref($hook, &$reference_parameter)
7.x command.inc drush_command_invoke_all_ref($hook, &$reference_parameter)
3.x command.inc drush_command_invoke_all_ref($hook, &$reference_parameter)
4.x command.inc drush_command_invoke_all_ref($hook, &$reference_parameter)
5.x command.inc drush_command_invoke_all_ref($hook, &$reference_parameter)
master command.inc drush_command_invoke_all_ref($hook, &$reference_parameter)
1 call to drush_command_invoke_all_ref()
drush_pm_relocate_project in commands/pm/pm.drush.inc
drush_pm_relocate_project moves projects that should be relocated to a different installation directory to the location they belong in. For example, modules that are only collections of drush commands will be installed to $HOME/.drush.
1 string reference to 'drush_command_invoke_all_ref'
drush_command_invoke_all in includes/command.inc
Invoke a hook in all available command files that implement it.

File

includes/command.inc, line 416
The drush command engine.

Code

function drush_command_invoke_all_ref($hook, &$reference_parameter) {
  $args = func_get_args();
  array_shift($args);
  // Insure that call_user_func_array can alter first parameter
  $args[0] = &$reference_parameter;
  $return = array();
  foreach (drush_command_implements($hook) as $module) {
    $function = $module . '_' . $hook;
    $result = call_user_func_array($function, $args);
    if (isset($result) && is_array($result)) {
      $return = array_merge_recursive($return, $result);
    }
    else if (isset($result)) {
      $return[] = $result;
    }
  }
  return $return;
}