From 044379d18fbfb7673e5a5992e9c5af7830e358a8 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 8 May 2008 18:57:58 +0000 Subject: added 'object' key to the XML-RPCS config allowing the passing of a class object for method calls that aren't part of the CI super object --- system/libraries/Xmlrpcs.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 1b2ffca05..7a4bc825e 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -41,7 +41,9 @@ class CI_Xmlrpcs extends CI_Xmlrpc var $system_methods = array(); // XML RPC Server methods var $controller_obj; - + var $object = FALSE; + + //------------------------------------- // Constructor, more or less //------------------------------------- @@ -74,6 +76,11 @@ class CI_Xmlrpcs extends CI_Xmlrpc { $this->debug = $config['debug']; } + + if (isset($config['object']) && is_object($config['object'])) + { + $this->object = $config['object']; + } } //------------------------------------- @@ -320,11 +327,16 @@ class CI_Xmlrpcs extends CI_Xmlrpc } else { - $CI =& get_instance(); - return $CI->$method_parts['1']($m); - //$class = new $method_parts['0']; - //return $class->$method_parts['1']($m); - //return call_user_func(array(&$method_parts['0'],$method_parts['1']), $m); + if ($this->object === FALSE) + { + $CI =& get_instance(); + return $CI->$method_parts['1']($m); + } + else + { + return $this->object->$method_parts['1']($m); + //return call_user_func(array(&$method_parts['0'],$method_parts['1']), $m); + } } } else -- cgit v1.2.3-24-g4f1b