From 4b9405ca9531c5e6c08b22cb1f952b1c060565f3 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Wed, 3 May 2023 12:23:20 -0700 Subject: [PATCH] CLI-1046: Cannot assign null to DatabaseResponse::user_name (#1485) * CLI-1046: Cannot assign null to DatabaseResponse::user_name * update * update * Unfork * fix version constraint --- composer.json | 2 +- composer.lock | 55 +++++++++++++--------------- src/Command/Pull/PullCommandBase.php | 12 +++++- 3 files changed, 36 insertions(+), 33 deletions(-) diff --git a/composer.json b/composer.json index 69e59274b..a61a8b62f 100644 --- a/composer.json +++ b/composer.json @@ -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" }, diff --git a/composer.lock b/composer.lock index 34f304cfb..dfa4f5f36 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7136c4132953b2aad31ad7536a1ebc6f", + "content-hash": "e8610da573e6eafcac585b073f246d98", "packages": [ { "name": "acquia/drupal-environment-detector", @@ -2124,16 +2124,16 @@ }, { "name": "php-http/discovery", - "version": "1.17.0", + "version": "1.18.0", "source": { "type": "git", "url": "https://github.com/php-http/discovery.git", - "reference": "bd810d15957cf165230e65d9e1a130793265e3b7" + "reference": "29ae6fae35f4116bbfe4c8b96ccc3f687eb07cd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/bd810d15957cf165230e65d9e1a130793265e3b7", - "reference": "bd810d15957cf165230e65d9e1a130793265e3b7", + "url": "https://api.github.com/repos/php-http/discovery/zipball/29ae6fae35f4116bbfe4c8b96ccc3f687eb07cd9", + "reference": "29ae6fae35f4116bbfe4c8b96ccc3f687eb07cd9", "shasum": "" }, "require": { @@ -2196,9 +2196,9 @@ ], "support": { "issues": "https://github.com/php-http/discovery/issues", - "source": "https://github.com/php-http/discovery/tree/1.17.0" + "source": "https://github.com/php-http/discovery/tree/1.18.0" }, - "time": "2023-04-26T15:39:13+00:00" + "time": "2023-05-03T14:49:12+00:00" }, { "name": "php-http/httplug", @@ -6470,16 +6470,16 @@ }, { "name": "typhonius/acquia-php-sdk-v2", - "version": "3.0.7", + "version": "3.0.8", "source": { "type": "git", "url": "https://github.com/typhonius/acquia-php-sdk-v2.git", - "reference": "06fa9c8fc1e2e0976ab9883533ae1bd276cabf4f" + "reference": "1a43bafbae3978cf8aac51f6f6cd0ac509885adb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/typhonius/acquia-php-sdk-v2/zipball/06fa9c8fc1e2e0976ab9883533ae1bd276cabf4f", - "reference": "06fa9c8fc1e2e0976ab9883533ae1bd276cabf4f", + "url": "https://api.github.com/repos/typhonius/acquia-php-sdk-v2/zipball/1a43bafbae3978cf8aac51f6f6cd0ac509885adb", + "reference": "1a43bafbae3978cf8aac51f6f6cd0ac509885adb", "shasum": "" }, "require": { @@ -6523,7 +6523,7 @@ "description": "A PHP SDK for Acquia CloudAPI v2", "support": { "issues": "https://github.com/typhonius/acquia-php-sdk-v2/issues", - "source": "https://github.com/typhonius/acquia-php-sdk-v2/tree/3.0.7" + "source": "https://github.com/typhonius/acquia-php-sdk-v2/tree/3.0.8" }, "funding": [ { @@ -6531,7 +6531,7 @@ "type": "github" } ], - "time": "2023-05-02T19:10:19+00:00" + "time": "2023-05-03T19:17:56+00:00" }, { "name": "violuke/rsa-ssh-key-fingerprint", @@ -10092,12 +10092,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "5e3dfa62068e207fd3b00be0f6d4657185c1b262" + "reference": "a4fe21553eb3bbf33bbecf26cb0e2f0973f50c83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/5e3dfa62068e207fd3b00be0f6d4657185c1b262", - "reference": "5e3dfa62068e207fd3b00be0f6d4657185c1b262", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/a4fe21553eb3bbf33bbecf26cb0e2f0973f50c83", + "reference": "a4fe21553eb3bbf33bbecf26cb0e2f0973f50c83", "shasum": "" }, "conflict": { @@ -10360,7 +10360,7 @@ "modx/revolution": "<= 2.8.3-pl|<2.8", "mojo42/jirafeau": "<4.4", "monolog/monolog": ">=1.8,<1.12", - "moodle/moodle": "<4.0.7|>=4.1-beta,<4.1.2|= 3.11", + "moodle/moodle": "<4.2-rc.2|= 3.11", "mustache/mustache": ">=2,<2.14.1", "namshi/jose": "<2.2", "neoan3-apps/template": "<1.1.1", @@ -10690,7 +10690,7 @@ "type": "tidelift" } ], - "time": "2023-05-01T23:04:11+00:00" + "time": "2023-05-03T00:13:26+00:00" }, { "name": "sanmai/later", @@ -12075,16 +12075,16 @@ }, { "name": "twig/twig", - "version": "v3.5.1", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "a6e0510cc793912b451fd40ab983a1d28f611c15" + "reference": "106c170d08e8415d78be2d16c3d057d0d108262b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/a6e0510cc793912b451fd40ab983a1d28f611c15", - "reference": "a6e0510cc793912b451fd40ab983a1d28f611c15", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/106c170d08e8415d78be2d16c3d057d0d108262b", + "reference": "106c170d08e8415d78be2d16c3d057d0d108262b", "shasum": "" }, "require": { @@ -12093,15 +12093,10 @@ "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { - "psr/container": "^1.0", + "psr/container": "^1.0|^2.0", "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.5-dev" - } - }, "autoload": { "psr-4": { "Twig\\": "src/" @@ -12135,7 +12130,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.5.1" + "source": "https://github.com/twigphp/Twig/tree/v3.6.0" }, "funding": [ { @@ -12147,7 +12142,7 @@ "type": "tidelift" } ], - "time": "2023-02-08T07:49:20+00:00" + "time": "2023-05-03T19:06:57+00:00" }, { "name": "webmozart/assert", diff --git a/src/Command/Pull/PullCommandBase.php b/src/Command/Pull/PullCommandBase.php index f98d3428f..1a5006761 100644 --- a/src/Command/Pull/PullCommandBase.php +++ b/src/Command/Pull/PullCommandBase.php @@ -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);