Skip to content

Commit

Permalink
sql:sync minor cleanup (#5044)
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Jan 25, 2022
1 parent 8a1b0ad commit 14d5598
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/Commands/sql/SqlSyncCommands.php
Expand Up @@ -125,16 +125,15 @@ public function databaseName(SiteAlias $record): string
}

/**
* Perform sql-dump on source unless told otherwise.
* Perform sql-dump on source unless told otherwise. Returns the path to the dump file.
*
* @param $options
* @param $global_options
* @param $sourceRecord
*
* Path to the source dump file.
* @throws \Exception
*/
public function dump($options, $global_options, $sourceRecord): string
public function dump(array $options, array $global_options, SiteAlias $sourceRecord): string
{
$dump_options = $global_options + [
'gzip' => true,
Expand All @@ -148,17 +147,8 @@ public function dump($options, $global_options, $sourceRecord): string
if ($this->getConfig()->simulate()) {
$source_dump_path = '/simulated/path/to/dump.tgz';
} else {
// First try a Drush 9.6+ return format.
$json = $process->getOutputAsJson();
if (!empty($json['path'])) {
$source_dump_path = $json['path'];
} else {
// Next, try 9.5- format.
$return = drush_backend_parse_output($process->getOutput());
if (!$return['error_status'] || !empty($return['object'])) {
$source_dump_path = $return['object'];
}
}
$source_dump_path = $json['path'];
}
} else {
$source_dump_path = $options['source-dump'];
Expand Down

0 comments on commit 14d5598

Please sign in to comment.