20 lines
468 B
PHP
20 lines
468 B
PHP
<?php
|
|
namespace ProVM\Database;
|
|
|
|
use ProVM\Implement\Database;
|
|
|
|
class PostgreSQL extends Database
|
|
{
|
|
public function getDsn(): string
|
|
{
|
|
$dsn = ["pgsql:host={$this->getHost()}"];
|
|
if ($this->getPort()) {
|
|
$dsn []= "port={$this->getPort()}";
|
|
}
|
|
$dsn []= "dbname={$this->getName()}";
|
|
$dsn []= "user={$this->getUser()}";
|
|
$dsn []= "password={$this->getPassword()}";
|
|
return implode(';', $dsn);
|
|
}
|
|
}
|