From 07660565702bcabac10263deaa54ac89a5eca391 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 4 Jun 2010 12:37:55 +0000 Subject: [PATCH] Added debugging to rpc class. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18847 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_jsonRPC.inc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gosa-core/include/class_jsonRPC.inc b/gosa-core/include/class_jsonRPC.inc index 247f05411..54cb8b72d 100644 --- a/gosa-core/include/class_jsonRPC.inc +++ b/gosa-core/include/class_jsonRPC.inc @@ -21,6 +21,10 @@ class jsonRPC { $user = $this->config->get_cfg_value('core','gosaRpcUser'); $passwd = $this->config->get_cfg_value('core','gosaRpcPassword'); + DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,bold($url), "Initiated RPC "); + DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,bold($user), "RPC user: "); + DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,bold($passwd),"RPC password: "); + // Init Curl handler $this->curlHandler = curl_init($url); @@ -35,7 +39,6 @@ class jsonRPC { // Try to login $this->login($user, $passwd); - DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,"RPC Login ".$this->get_error() , "Login"); } @@ -72,7 +75,15 @@ class jsonRPC { $this->__login(); } + // Start request + DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,"{$method}", "Calling: "); $response = $this->request($method,$params); + if($this->success()){ + DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,bold($response['result']), "Result: "); + }else{ + DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,bold($this->get_error())."
".$response, "Result (FAILED): "); + } + return($response['result']); } -- 2.30.2