Added db port support for backup command

This commit is contained in:
Dan Brown 2023-03-03 21:16:15 +00:00
parent ead5ebbee1
commit ff0c183a66
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9

View file

@ -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}");