[eluser]WoolyG[/eluser]
Hi all,
I'm creating a new library, and need to utilise the existing XMLRPC library for it to work.
After calling the new library, when I try to call
Code:
$this->mylibraryclass->send_request($method, $request_array);
I get this (see italicised text):
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Mylibraryclass::$xmlrpc
Filename: libraries/mylibraryclass.php
Line Number: 63
Here's the code:
Code:
class Mylibraryclass {
const VERSION = "0.1";
const PLATFORM = "web";
const HARDWARE_VERSION = "1.0";
const SOFTWARE_VERSION = "PHP";
const APP_VERSION = "1.0";
const SERVER = "http://myrpcserver.com/";
const PORT = 123456;
public function __construct()
{
$CI =& get_instance();
$CI->load->library('xmlrpc');
}
/**
* @param $method
* @param array $request_array
* @return mixed
*/
public function send_request($method, array $request_array)
{
/**
* // Example from codeigniter user guide:
*
* $this->load->library('xmlrpc'); // Autoloaded
$this->xmlrpc->server('http://rpc.pingomatic.com/', 80);
$this->xmlrpc->method('weblogUpdates.ping');
$request = array('My Photoblog', 'http://www.my-site.com/photoblog/');
$this->xmlrpc->request($request);
if ( ! $this->xmlrpc->send_request())
{
echo $this->xmlrpc->display_error();
}
*/
//$this->xmlrpc->set_debug(TRUE);
$this->xmlrpc->server(SERVER, PORT); // This is line 63
$this->xmlrpc->method($method);
$this->xmlrpc->request($request_array);
$this->xmlrpc->send_request();
if ( ! $this->xmlrpc->send_request())
{
$response = $this->xmlrpc->display_error();
}
else
{
$response = $this->xmlrpc->display_response();
}
return $response;
}
}
Does this have something to do with the way I'm calling $this->xmlrpc->.. ? I've tried $CI->xmlrpc->.. to no avail.
All help is appreciated!
Thanks
WoolyG