Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql:sync minor cleanup #5044

Merged
merged 1 commit into from Jan 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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