function drush_sql_sync

6.x sync.sql.inc drush_sql_sync($source = NULL, $destination = NULL)
3.x sync.sql.inc drush_sql_sync($source = null, $destination = null)
4.x sync.sql.inc drush_sql_sync($source = NULL, $destination = NULL)
5.x sync.sql.inc drush_sql_sync($source = NULL, $destination = NULL)
1 call to drush_sql_sync()
drush_upgrade_site_upgrade in commands/core/upgrade.drush.inc
A drush command callback.

File

commands/sql/sync.sql.inc, line 5

Code

function drush_sql_sync($source = null, $destination = null) {
  $source_database = drush_get_option('source-database', 'default');
  $source_target = drush_get_option('source-target');
  $target_database = drush_get_option('target-database', 'default');
  $target_target = drush_get_option('target-target');

  //
  // If the destination was not explicitly set, but a particular
  // target database was specified on the command line, then we
  // will implicitly assume that the destination alias is the
  // same as the source alias.
  //
  if (!isset($destination) && (isset($target_database) || (isset($target_target)))) {
    $destination = $source;
  }

  //
  // If there is no destination specification, then exit.
  //
  if (!isset($destination)) {
    drush_print(dt("You must specify a destination target."));
    exit(1);
  }
  //
  // Default branch:  copy 'sync' with the specified source
  // and destination.
  //
  else {
    _drush_sql_sync($source, $destination, TRUE);
  }
}