From ff0c183a66762b2c7cd2026f0c71b338dbcaa511 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Fri, 3 Mar 2023 21:16:15 +0000 Subject: [PATCH] Added db port support for backup command --- scripts/Commands/BackupCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/Commands/BackupCommand.php b/scripts/Commands/BackupCommand.php index e6cbc9096..f2c47a27f 100644 --- a/scripts/Commands/BackupCommand.php +++ b/scripts/Commands/BackupCommand.php @@ -150,6 +150,11 @@ final class BackupCommand 'database' => ($_SERVER['DB_DATABASE'] ?? ''), ]; + $port = $_SERVER['DB_PORT'] ?? ''; + if ($port) { + $dbOptions['host'] .= ':' . $port; + } + foreach ($dbOptions as $name => $option) { if (!$option) { throw new CommandError("Could not find a value for the database {$name}");