From e02fe6db1d2581ec5c5209b7739d90ab6831ed55 Mon Sep 17 00:00:00 2001 From: Gregory Duchatelet Date: Mon, 30 Mar 2020 17:14:03 +0200 Subject: [PATCH 1/2] add port --- src/ExtendedServer.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ExtendedServer.php b/src/ExtendedServer.php index 33d1b1c..3e8ebd6 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, From 8e848252b61842323dc1be376d2dc78c9a689ffd Mon Sep 17 00:00:00 2001 From: Gregory Duchatelet Date: Mon, 30 Mar 2020 17:52:31 +0200 Subject: [PATCH 2/2] add port to __toString --- src/ExtendedServer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ExtendedServer.php b/src/ExtendedServer.php index 3e8ebd6..a3ea896 100644 --- a/src/ExtendedServer.php +++ b/src/ExtendedServer.php @@ -61,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() {