Auth, Login, Home, Venta->Listados->Precios
This commit is contained in:
24
app/common/Implement/Database/MySQL.php
Normal file
24
app/common/Implement/Database/MySQL.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace Incoviba\Common\Implement\Database;
|
||||
|
||||
use Incoviba\Common\Define;
|
||||
|
||||
class MySQL implements Define\Database
|
||||
{
|
||||
public function __construct(public string $host, public string $name, public string $user, public string $password) {}
|
||||
|
||||
public int $port = 3306;
|
||||
|
||||
public function getDSN(): string
|
||||
{
|
||||
$dsn = "mysql:host={$this->host};dbname={$this->name}";
|
||||
if ($this->port !== 3306) {
|
||||
$dsn .= ";port={$this->port}";
|
||||
}
|
||||
return $dsn;
|
||||
}
|
||||
public function needsUser(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user