infusionsoft/PHP-iSDK — pull request #3 by innerbot (2012-11-26 01:06:42+00:00)
Title: Eliminate conn file dependency

In an effort to remove unnecessary dependencies, I tweaked the cfgCon and vendorCon methods to allow the passing of connection details via the method call, rather than depending on an external file.

However, I realize that many people are already using the existing conn.cfg.php approach, so I left that option in place for backwards compatibility.

As you can see the method call to cfgCon has changed from:

iSDK::cfgConn( $name, $db = 'on' )

to this:

iSDK::cfgConn( $name, $db = 'on', $api_key = '', $conn_to = 'i' )

the new method simply performs a quick check to see if the $api_key variable is empty or not. If it's not empty, it builds the $connInfo array right there, otherwise it falls back to depending on conn.cfg.php.

The same can be said for iSDK::vendorCon().