diff --git a/src/ExtendedServer.php b/src/ExtendedServer.php index 33d1b1c..a3ea896 100644 --- a/src/ExtendedServer.php +++ b/src/ExtendedServer.php @@ -9,6 +9,7 @@ abstract class ExtendedServer { protected $host; + protected $port; protected $user; protected $password; protected $dbname; @@ -26,6 +27,7 @@ public function __construct(array $params) foreach ($params as $key => $value) { switch ($key) { case 'host': + case 'port': case 'user': case 'password': case 'dbname': @@ -44,6 +46,7 @@ public function __construct(array $params) public function dbalConfig(): array { return [ 'host' => $this->host, + 'port' => $this->port, 'user' => $this->user, 'password' => $this->password, 'dbname' => $this->dbname, @@ -58,7 +61,7 @@ public function isConnected(): bool { public function __toString() { - return get_class($this) . ' - ' . $this->user . '@' . $this->host . ':' . $this->dbname; + return get_class($this) . ' - ' . $this->user . '@' . $this->host . ':' . $this->port . '/' . $this->dbname; } public function close() {