When instantiating the toolkit, users who pass in a database connection that is not ibm_db2 must either specify the transport type in parameter 4 or change toolkit.ini. It's extra work and makes it hard to remember what parameters need to be passed. The toolkit could, instead, automatically detect the transport type when a database connection is passed as parameter 1.
Here is the constructor: https://github.com/zendtech/IbmiToolkit/blob/e9852fb2fd4b593c1d33d084b60a0b39831bda1b/ToolkitApi/ToolkitService.php#L25
ibm_db2 and odbc database connections could be detected with get_resource_type(). The result will be DB2 Connection, DB2 Persistent Connection, odbc link, or odbc link persistent.
PDO database connections could be detected with $databaseNameOrResource instanceof PDO.
When instantiating the toolkit, users who pass in a database connection that is not ibm_db2 must either specify the transport type in parameter 4 or change toolkit.ini. It's extra work and makes it hard to remember what parameters need to be passed. The toolkit could, instead, automatically detect the transport type when a database connection is passed as parameter 1. Here is the constructor: https://github.com/zendtech/IbmiToolkit/blob/e9852fb2fd4b593c1d33d084b60a0b39831bda1b/ToolkitApi/ToolkitService.php#L25
DB2 Connection
,DB2 Persistent Connection
,odbc link
, orodbc link persistent
.$databaseNameOrResource instanceof PDO
.