Files
database/src/Database/MySQL.php
Juan Pablo Vial 0df2e95e7f Implementations
2022-09-08 20:02:05 -04:00

29 lines
513 B
PHP

<?php
namespace ProVM\Database;
use ProVM\Alias\Database;
class MySQL extends Database
{
public function needsUser(): bool
{
return true;
}
public function getDSN(): string
{
$arr = [
"host={$this->getHost()}"
];
if (isset($this->port)) {
$arr []= "port={$this->getPort()}";
}
$arr []= "dbname={$this->getName()}";
return implode(':', [
'mysql',
implode(';', $arr)
]);
}
}