function drush_sitealias_check_lists_alignment

6.x sitealias.inc drush_sitealias_check_lists_alignment($source, $target)
3.x sitealias.inc drush_sitealias_check_lists_alignment($source, $target)
4.x sitealias.inc drush_sitealias_check_lists_alignment($source, $target)
5.x sitealias.inc drush_sitealias_check_lists_alignment($source, $target)

Check to see if the uri is the same in the source and target lists for all items in the array. This is a strong requirement in D6; in D7, it is still highly convenient for the uri to be the same, because the site folder name == the uri, and if the uris match, then it is easier to rsync between remote machines.

Parameters

$source: Array of source alias records

$target: Array of target alias records to compare against source list

Return value

TRUE iff the uris of the sources and targets are in alignment

1 call to drush_sitealias_check_lists_alignment()
drush_do_multiple_command in includes/drush.inc
Used by functions that operate on lists of sites, moving information from the source to the destination. Currenlty this includes 'drush rsync' and 'drush sql sync'.

File

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

Code

function drush_sitealias_check_lists_alignment($source, $target) {
  $is_aligned = TRUE;

  $i = 0;
  foreach ($source as $one_source) {
    if ((!isset($target[$i])) || (!_drush_sitelist_check_site_records($one_source, $target[$i]))) {
      $is_aligned = FALSE;
      break;
    }
    ++$i;
  }

  return $is_aligned;
}