CodeIgniter Forums

Full Version: Need help understanding external libraries in CI
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
I have been working with an this standalone api library for a product called InfusionSoft for a while.

It consists of a folder for the php libraries: xmlrpc-2.0

A isdk.php which at the top includes the xmlrpc: include("xmlrpc-2.0/lib/xmlrpc.inc");

and it establishes the iSDK class which defines the functions I use like sending data or updating contact information.

public function addContact($XX) {... }
public function updateCon(XX {... }
ETC



And Then my main program test.php which at the top includes the iSDK.php and creates an object of that class to preform the action required by the user.

include 'isdk.php';
$myApp = new iSDK;


$myApp->ConnectToServer();
$myApp->addContact("James", "555-555-5555");



I am totally lost on how to bring this into CodeIgniter.

I am assuming that I would make the isdk.php a controller but where do I put the xmlrpc-2.0 and how do I link it into the isdk controller ?

Which I would give the isdk controller a name like "contacts" since it holds the contact functions

El Forum

[eluser]WanWizard[/eluser]
If you make sure isdk follows the CI rules for libraries, you can load and use it like any other library:
Code:
$this->load->library('isdk');
$this->isdk->ConnectToServer();

El Forum

[eluser]Daniel Cronin[/eluser]
Hi,

Infusionsoft iSDK is using an old php xml rpc library which will not work with CodeIgniter.

You can not replace it with CodeIgniter's XML_RPC library because it does not support SSL.

All you have to do is download the latest version here... http://phpxmlrpc.sourceforge.net/ and copy over the old files in the iSDK.

Then you should be able to load it like any other library as WanWizard said.

Best regards,
Daniel