Skip to content

Commit

Permalink
fixing pg configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ioigoume committed Aug 21, 2024
1 parent 1fd49dc commit af24dd1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static function loadPGDatabase(): array
$pgContainer = PostgresContainer::make('15.0', 'password');
$pgContainer->withPostgresDatabase('database');
$pgContainer->withPostgresUser('username');
$hostPort = getenv('HOSTPORT') ?? '5432';
$hostPort = getenv('HOSTPORT') ?: '5432';
$pgContainer->withPort($hostPort, '5432');

$pgContainer->run();
Expand All @@ -135,7 +135,7 @@ public static function loadPGDatabase(): array
// Wait until that message is in the logs
$pgContainer->withWait(new WaitForLog('Ready to accept connections'));

$hostAddress = getenv('HOSTADDRESS') ?? $pgContainer->getAddress();
$hostAddress = getenv('HOSTADDRESS') ?: $pgContainer->getAddress();
$pgConfig = [
'database.dsn' => sprintf(
'pgsql:host=%s;port=%s;dbname=database',
Expand Down

0 comments on commit af24dd1

Please sign in to comment.