diff --git a/src/MySQL.php b/src/MySQL.php new file mode 100644 index 0000000..1cf17a0 --- /dev/null +++ b/src/MySQL.php @@ -0,0 +1,32 @@ + $host + ]; + if ($port !== null) { + $host_arr['port'] = $port; + } + $this->host = (object) $host_arr; + $this->name = $name; + } + public function dsn(): string { + $dsn = [ + 'host=' . $this->host->name + ]; + if (isset($this->host->port)) { + $dsn []= 'port=' . $this->host->port; + } + $dsn []= 'dbname=' . $this->name; + return 'mysql:' . implode(';', $dsn); + } + public function hasLogin(): bool { + return true; + } +} \ No newline at end of file