Skip to content

Commit

Permalink
Fix url construction
Browse files Browse the repository at this point in the history
  • Loading branch information
Prokyonn committed Jul 25, 2024
1 parent 5956d8c commit 94eba94
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions SuluPhpcrMigrationBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,14 @@ private function getConnectionConfiguration(string $dsn): array
return $result;
}

$result['connection']['url'] = \sprintf(
'%s:%s%s%s',
$result['connection']['url'] = \implode('', \array_filter([
$parts['host'] ?? '',
$parts['port'] ?? '',
$parts['path'] ?? '',
isset($parts['port']) ? ':' . $parts['port'] : null,
$parts['path'] ?? null,
$query ? '?' . \http_build_query($query) : '',
);
], function($value) {
return null !== $value && '' !== $value;
}));
$result['connection']['user'] = $parts['user'] ?? null;
$result['connection']['password'] = $parts['pass'] ?? null;

Expand Down

0 comments on commit 94eba94

Please sign in to comment.