function drush_sitealias_resolve_sitespecs

8.0.x sitealias.inc drush_sitealias_resolve_sitespecs($site_specifications, $alias_path_context = NULL)
6.x sitealias.inc drush_sitealias_resolve_sitespecs($site_specifications, $alias_path_context = NULL)
7.x sitealias.inc drush_sitealias_resolve_sitespecs($site_specifications, $alias_path_context = NULL)
3.x sitealias.inc drush_sitealias_resolve_sitespecs($site_specifications)
4.x sitealias.inc drush_sitealias_resolve_sitespecs($site_specifications)
5.x sitealias.inc drush_sitealias_resolve_sitespecs($site_specifications, $alias_path_context = NULL)
master sitealias.inc drush_sitealias_resolve_sitespecs($site_specifications, $alias_path_context = NULL)

Given an array of site specifications, resolve each one in turn and return an array of alias records. If you only want a single record, it is preferable to simply call drush_sitealias_get_record directly.

Parameters

$site_specifications: One of: A comma-separated list of site specifications: '@site1,@site2' An array of site specifications: array('@site1','@site2') An array of alias records: array( 'site1' => array('root' => ...), 'site2' => array('root' => ...) ) An array of site specifications. @see drush_sitealias_get_record() for the format of site specifications.

Return value

An array of alias records

3 calls to drush_sitealias_resolve_sitespecs()
drush_archive_dump in commands/core/archive.drush.inc
Command callback. Generate site archive file.
drush_invoke_process in includes/command.inc
Invoke a command in a new process, targeting the site specified by the provided site alias record.
_drush_sitealias_user_specified_list in commands/core/sitealias.drush.inc
Return the list of site aliases (remote or local) that the user specified on the command line. If none were specified, then all are returned.

File

includes/sitealias.inc, line 146
The site alias API.

Code

function drush_sitealias_resolve_sitespecs($site_specifications, $alias_path_context = NULL) {
  $result_list = array();
  $not_found = array();
  if (!is_array($site_specifications)) {
    $site_specifications = explode(',', $site_specifications);
  }
  if (!empty($site_specifications)) {
    foreach ($site_specifications as $site) {
      if (is_array($site)) {
        $result_list[] = $site;
      }
      else {
        $alias_record = drush_sitealias_get_record($site, $alias_path_context);
        if (!$alias_record) {
          $not_found[] = $site;
        }
        else {
          $result_list = array_merge($result_list, drush_sitealias_resolve_sitelist($alias_record));
        }
      }
    }
  }
  return array($result_list, $not_found);
}