+ $r = call_user_func_array($func, array($methName, $params, $this->user_data));\r
+ // mimic EPI behaviour: if we get an array that looks like an error, make it\r
+ // an eror response\r
+ if (is_array($r) && array_key_exists('faultCode', $r) && array_key_exists('faultString', $r))\r
+ {\r
+ $r = new xmlrpcresp(0, (integer)$r['faultCode'], (string)$r['faultString']);\r
+ }\r
+ else\r
+ {\r
+ // functions using EPI api should NOT return resp objects,\r
+ // so make sure we encode the return type correctly\r
+ $r = new xmlrpcresp(php_xmlrpc_encode($r, array('extension_api')));\r
+ }\r