CodeIgniter Forums
Need help understanding external libraries in CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Need help understanding external libraries in CI (/showthread.php?tid=32918)



Need help understanding external libraries in CI - El Forum - 08-09-2010

[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


Need help understanding external libraries in CI - El Forum - 08-09-2010

[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();



Need help understanding external libraries in CI - El Forum - 10-22-2010

[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