function annotationcommand_adapter_refine_searchpaths

master annotationcommand_adapter_refine_searchpaths($searchpath)

In some circumstances, Drush just does a deep search for any * file, so that it can find all commands, in enabled and disabled modules alike, for the purpose of displaying the help text for that command.

1 call to annotationcommand_adapter_refine_searchpaths()
annotationcommand_adapter_discover in includes/
Search for annotation commands at the provided search path.


includes/, line 788


function annotationcommand_adapter_refine_searchpaths($searchpath) {
  $result =[];
  foreach ($searchpath as $path) {
    $max_depth = TRUE;
    $pattern = '/.*\.info$/';
    if (drush_drupal_major_version() > 7) {
      $pattern = '/.*\.info.yml$/';
    $locations = drush_scan_directory($path, $pattern, ['.' '..'], false, $max_depth);

    // Search for any directory that might be a module or theme (contains
    // a *.info or a *.info.yml file)
    foreach ($locations as $key => $info) {
      $result[dirname($key)] = true;
  return array_keys($result);