function _drush_pm_expand_extensions

8.0.x pm.drush.inc _drush_pm_expand_extensions(&$extensions, $extension_info = array())
6.x pm.drush.inc _drush_pm_expand_extensions(&$extensions, $extension_info = array())
7.x pm.drush.inc _drush_pm_expand_extensions(&$extensions, $extension_info = array())
4.x pm.drush.inc _drush_pm_expand_extensions(&$extensions, $extension_info = array())
5.x pm.drush.inc _drush_pm_expand_extensions(&$extensions, $extension_info = array())
master pm.drush.inc _drush_pm_expand_extensions(&$extensions, $extension_info = array())

Add extensions that match extension_name*.

A helper function for commands that take a space separated list of extension names. It will identify extensions that have been passed in with a trailing * and add all matching extensions to the array that is returned.

Parameters

$extensions: An array of extensions, by reference.

$extension_info: Optional. An array of extension info as returned by drush_get_extensions().

2 calls to _drush_pm_expand_extensions()
drush_pm_classify_extensions in commands/pm/pm.drush.inc
Classify extensions as modules, themes or unknown.
drush_pm_info in commands/pm/info.pm.inc
Command callback. Show detailed info for one or more extensions.

File

commands/pm/pm.drush.inc, line 1214
The drush Project Manager

Code

function _drush_pm_expand_extensions(&$extensions, $extension_info = array()) {
  if (empty($extension_info)) {
    $extension_info = drush_get_extensions();
  }
  foreach ($extensions as $key => $extension) {
    if (($wildcard = rtrim($extension, '*')) !== $extension) {
      foreach (array_keys($extension_info) as $extension_name) {
        if (substr($extension_name, 0, strlen($wildcard)) == $wildcard) {
          $extensions[] = $extension_name;
        }
      }
      unset($extensions[$key]);
      continue;
    }
  }
}