Skip to content

Commit

Permalink
CLI-1046: Cannot assign null to DatabaseResponse::user_name (#1485)
Browse files Browse the repository at this point in the history
* CLI-1046: Cannot assign null to DatabaseResponse::user_name

* update

* update

* Unfork

* fix version constraint
  • Loading branch information
danepowell authored May 3, 2023
1 parent 556c52d commit 4b9405c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 33 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"symfony/yaml": "^6.0",
"thecodingmachine/safe": "^2.4",
"typhonius/acquia-logstream": "^0.0.13",
"typhonius/acquia-php-sdk-v2": "^3.0.7",
"typhonius/acquia-php-sdk-v2": "^3.0.8",
"violuke/rsa-ssh-key-fingerprint": "^1.1",
"zumba/amplitude-php": "^1.0.4"
},
Expand Down
55 changes: 25 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions src/Command/Pull/PullCommandBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,19 @@ abstract class PullCommandBase extends CommandBase {
* @return string
*/
public static function getBackupPath($environment, DatabaseResponse $database, $backup_response): string {
// Filename roughly matches what you'd get with a manual download from Cloud UI.
// Databases have a machine name not exposed via the API; we can only
// approximately reconstruct it and match the filename you'd get downloading
// a backup from Cloud UI.
if ($database->flags->default) {
$dbMachineName = $database->name . $environment->name;
}
else {
$dbMachineName = 'db' . $database->id;
}
$filename = implode('-', [
$environment->name,
$database->name,
trim(parse_url($database->url, PHP_URL_PATH), '/'),
$dbMachineName,
$backup_response->completedAt,
]) . '.sql.gz';
return Path::join(sys_get_temp_dir(), $filename);
Expand Down

0 comments on commit 4b9405c

Please sign in to comment.