Permalink
Browse files

Added ability to specify port

  • Loading branch information...
1 parent c42f0bd commit 2f387d4f8c0160d93992eadd381eabe6e486d669 @radnan committed Sep 29, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 library/Zend/Db/Adapter/Driver/Pdo/Connection.php
@@ -197,6 +197,9 @@ public function connect()
case 'hostname':
$hostname = (string) $value;
break;
+ case 'port':
+ $port = (int) $value;
+ break;
case 'database':
case 'dbname':
$database = (string) $value;
@@ -225,6 +228,9 @@ public function connect()
if (isset($hostname)) {
$dsn[] = "host={$hostname}";
}
+ if (isset($port)) {
+ $dsn[] = "port={$port}";
+ }
break;
}
$dsn = $pdoDriver . ':' . implode(';', $dsn);

0 comments on commit 2f387d4

Please sign in to comment.