Skip to content

Commit

Permalink
Merge pull request #58 from gregorg/port
Browse files Browse the repository at this point in the history
add port
  • Loading branch information
Greg authored Mar 30, 2020
2 parents c97f029 + 8e84825 commit 2315288
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ExtendedServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
abstract class ExtendedServer
{
protected $host;
protected $port;
protected $user;
protected $password;
protected $dbname;
Expand All @@ -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':
Expand All @@ -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,
Expand All @@ -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() {
Expand Down

0 comments on commit 2315288

Please sign in to comment.