-
Notifications
You must be signed in to change notification settings - Fork 122
Adding unix_socket to dsn variables in PDO Adapter #48
Conversation
Need test |
Ok, in progress... |
@Maks3w , I added test. Now look's better? |
Seems ok. I'll forward this to maintainers with more experience of this for evaluation. |
Hello again, @Maks3w . Who should to check the PR? Can I hope that it will be reviewed soon? |
ping @zendframework/community-review-team |
@@ -237,6 +240,9 @@ public function connect() | |||
if (isset($charset) && $pdoDriver != 'pgsql') { | |||
$dsn[] = "charset={$charset}"; | |||
} | |||
if (isset($unix_socket)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot set the unix socket if a hostname or port is passed, this is really only relevant for mysql as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot set the unix socket if a hostname or port is passed
I think, PDO can resolve this issue without problems and zend-db code does not needed additional 'if-else' for this case. But, if you think another, I can add some checks for host and port variables.
This is really only relevant for mysql as well.
In fact, PDO_PGSQL DSN can connect to unix socket too, but libpq-connect used "host" variable for path to socket.
What do you think I need to do? Add here if-condition for mysql-pdo only? Or add special condition for converting $unix_socket to $host variable for PDO_PGSQL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be best to add the if else statement since the manual does explicitly point it out for PDO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it might be better to throw an exception in that case; rather than leave it to undefined behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i'll try to resend PR tomorrow
Sorry, I don't have enough time to finish and test this PR. |
Hello @KIVagant I'll take care of the update in this case and update it based on what is needed. |
@mwillbanks, thank you. |
Issue #47 PR