zendtech / IbmiToolkit

PHP frontend to XMLSERVICE for IBM i development.
BSD 3-Clause "New" or "Revised" License
46 stars 34 forks source link

PdoSupp constructor only permits existing PDO objects to be used for toolkit connections #125

Closed alanseiden closed 3 years ago

alanseiden commented 4 years ago

https://github.com/zendtech/IbmiToolkit/blob/97d9599a9e8d159d5458bf0ad4902b18bf5d702f/ToolkitApi/PdoSupp.php#L56

Other "transport" constructors allow the toolkit the option of creating connections internally. This one gives an error unless a PDO object is passed in as the first parameter to the toolkit constructor. If we don't wish to support toolkit-created PDO connections then we should document the limitation.

alanseiden commented 3 years ago

Sample script for connecting to toolkit using a pdo_odbc connection: https://github.com/zendtech/IbmiToolkit/blob/master/samples/connect_pdo_odbc.php

alanseiden commented 3 years ago

We're thinking it's better to leave this as is and create the PDO connection ahead of time and pass it in, as documented in the link above. That way, people know what they are getting. We could document doing the same for other transports with further examples.

Closing issue.