diff --git a/webservice/clienttools/clienttools_syslog.php b/webservice/clienttools/clienttools_syslog.php index 55efa96..b0ba042 100644 --- a/webservice/clienttools/clienttools_syslog.php +++ b/webservice/clienttools/clienttools_syslog.php @@ -7,6 +7,12 @@ class Clienttools_Syslog{ private static $errorLogTemplate='[date] | [time] | ERROR | [session] | [user] | [location] | [error_detail] | ([error])'; + /** + * Parse an array into a string template + * @param $template The template string - array keys in square brackets : [date] | [time] | ERROR | [session] | [user] | [location] | [error_detail] | ([error]) + * @param $data The associative array to parse into template. Keys will replace [keys] in template string. + * @return string The parsed template string + */ private static function parseTemplate($template=NULL,$data=NULL){ $ret=null; if(is_array($data)){ @@ -17,7 +23,6 @@ class Clienttools_Syslog{ $txd=array_values($data); $ret=str_replace($txs,$txd,$template); }; -// echo print_r(Array('s'=>$txs,'d'=>$txd),true)."\n\n\n\n\n\n"; return $ret; } @@ -32,8 +37,12 @@ class Clienttools_Syslog{ } + /** + * Write a line to the log file. + * @param $line + * @return void + */ private static function writeLogLine($line=NULL){ -// echo('LOGFILE: '.realpath(self::getLogFile())); if($line){ $fp=fopen(self::getLogFile(),'a'); fwrite($fp,$line."\n"); @@ -46,7 +55,6 @@ class Clienttools_Syslog{ * @return boolean */ private static function doErrorLogging(){ -// $GLOBALS['default']['debugLevel']; //Another less secure way of finding the configured debugLevel return KTConfig::getSingleton()->get('explorerCPSettings/debugLevel')=='error' || self::doDebugLogging(); } @@ -58,51 +66,80 @@ class Clienttools_Syslog{ return KTConfig::getSingleton()->get('explorerCPSettings/debugLevel')=='debug'; } + /** + * Store a line in the log file.. the message and a json string containing the data information will be stored + * @param $user The logged in user + * @param $location Information about the location from whence the function was called + * @param $message The descriptive message explaining the debug data that follows + * @param $data The debug data - this will be converted to a json string. + * @return void + */ public static function logInfo($user,$location,$message,$data){ - list($usec, $sec) = explode(" ", microtime()); - $usec=ceil($usec*1000); - $entry=self::parseTemplate(self::$debugLogTemplate,array( - 'date' =>date('Y-m-d'), - 'time' =>date('h:i:s').':'.$usec, - 'user' =>$user, - 'session'=>session_id(), - 'location'=>$location, - 'debug_message'=>$message, - 'debug_data'=>json_encode($data) - )); - - self::writeLogLine($entry); + if(self::doDebugLogging()){ + list($usec, $sec) = explode(" ", microtime()); + $usec=ceil($usec*1000); + $entry=self::parseTemplate(self::$debugLogTemplate,array( + 'date' =>date('Y-m-d'), + 'time' =>date('h:i:s').':'.$usec, + 'user' =>$user, + 'session'=>session_id(), + 'location'=>$location, + 'debug_message'=>$message, + 'debug_data'=>json_encode($data) + )); + + self::writeLogLine($entry); + } } + /** + * Store a line in the log file.. A simple string to indicate a point in the software + * @param $user The logged in user + * @param $location Information about the location from whence the function was called + * @param $message A string indicating a point reached in the software + * @return void + */ public static function logTrace($user,$location,$message){ - list($usec, $sec) = explode(" ", microtime()); - $usec=ceil($usec*1000); - $entry=self::parseTemplate(self::$traceLogTemplate,array( - 'date' =>date('Y-m-d'), - 'time' =>date('h:i:s').':'.$usec, - 'user' =>$user, - 'session'=>session_id(), - 'location'=>$location, - 'trace_message'=>$message, - )); - - self::writeLogLine($entry); + if(self::doDebugLogging()){ + list($usec, $sec) = explode(" ", microtime()); + $usec=ceil($usec*1000); + $entry=self::parseTemplate(self::$traceLogTemplate,array( + 'date' =>date('Y-m-d'), + 'time' =>date('h:i:s').':'.$usec, + 'user' =>$user, + 'session'=>session_id(), + 'location'=>$location, + 'trace_message'=>$message, + )); + + self::writeLogLine($entry); + } } + /** + * Store a line in the log file.. An Error log + * @param $user The logged in user + * @param $location Information about the location from whence the function was called + * @param $detail A string providing information as to the context of the encountered error + * @param $err The exception object - this will be serialized + * @return void + */ public static function logError($user=NULL,$location=NULL,$detail=NULL,$err=NULL){ - list($usec, $sec) = explode(" ", microtime()); - $usec=ceil($usec*1000); - $entry=self::parseTemplate(self::$errorLogTemplate,array( - 'date' =>date('Y-m-d'), - 'time' =>date('h:i:s').':'.$usec, - 'user' =>$user, - 'session'=>session_id(), - 'location'=>$location, - 'error_detail'=>json_encode($detail), - 'error'=>json_encode($err), - )); - - self::writeLogLine($entry); + if(self::doErrorLogging()){ + list($usec, $sec) = explode(" ", microtime()); + $usec=ceil($usec*1000); + $entry=self::parseTemplate(self::$errorLogTemplate,array( + 'date' =>date('Y-m-d'), + 'time' =>date('h:i:s').':'.$usec, + 'user' =>$user, + 'session'=>session_id(), + 'location'=>$location, + 'error_detail'=>json_encode($detail), + 'error'=>json_encode($err), + )); + + self::writeLogLine($entry); + } } } diff --git a/webservice/clienttools/services/0.9/auth.php b/webservice/clienttools/services/0.9/auth.php index 5c6453d..27c16b4 100644 --- a/webservice/clienttools/services/0.9/auth.php +++ b/webservice/clienttools/services/0.9/auth.php @@ -3,7 +3,7 @@ class auth extends client_service { public function login(){ - $this->logTrace((__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $params=$this->AuthInfo; $username=$params['user']; @@ -72,7 +72,7 @@ class auth extends client_service { } public function japiLogin(){ - $this->logTrace((__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); global $default; $user=$this->KT->get_user_object_by_username($this->AuthInfo['user']); @@ -84,7 +84,7 @@ class auth extends client_service { } public function pickup_session(){ - $this->logTrace((__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $params=$this->AuthInfo; $app_type=$params['appType']; $session_id=$params['session']; @@ -101,7 +101,7 @@ class auth extends client_service { public function ping(){ - $this->logTrace((__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); global $default; $user=$this->KT->get_user_object_by_username($this->AuthInfo['user']); $versions=$this->handler->getServerVersions(); @@ -124,19 +124,19 @@ class auth extends client_service { } function logout($params){ - $this->logTrace((__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $params=$this->AuthInfo; $app_type=$params['appType']; $session_id=$params['session']; $ip=$_SERVER['REMOTE_ADDR']; $session=$this->KT->get_session(); - $this->logInfo((__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Logout Session Object (From KT)',$session); + $this->logInfo((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Logout Session Object (From KT)',$session); if(get_class($session)!='KTAPI_UserSession'){ $session = $this->KT->get_active_session($session_id, $ip, $app_type); } - $this->logInfo((__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Logout Session Object (To Logout)',$session); + $this->logInfo((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Logout Session Object (To Logout)',$session); if (PEAR::isError($session)){ return false; diff --git a/webservice/clienttools/services/0.9/kt.php b/webservice/clienttools/services/0.9/kt.php index d35f573..75ca7e2 100644 --- a/webservice/clienttools/services/0.9/kt.php +++ b/webservice/clienttools/services/0.9/kt.php @@ -8,7 +8,7 @@ class kt extends client_service { * */ function get_languages($passthru = false) { - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' ); + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' ); global $default; $oReg = & KTi18nregistry::getSingleton (); $aRegisteredLangs = $oReg->geti18nLanguages ( 'knowledgeTree' ); @@ -28,13 +28,13 @@ class kt extends client_service { } function get_rootfolder_detail($params) { - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' ); + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' ); $params ['folderId'] = '1'; $this->get_folder_detail ( $params ); } function get_folder_detail($params) { - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' ); + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' ); if (isset ( $params ['node'] ) && ! isset ( $params ['folderId'] )) { $params ['node'] = split ( '_', $params ['node'] ); $params ['folderId'] = $params ['node'] [1]; @@ -94,7 +94,7 @@ class kt extends client_service { } function get_folder_contents($params) { - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' ); + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' ); $kt = &$this->KT; $params ['control'] = 'F_'; @@ -119,7 +119,7 @@ class kt extends client_service { * @return array */ function get_folder_contents_for_grid($arr) { - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' ); + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' ); $kt = &$this->KT; $arr ['control'] = 'F_'; @@ -144,7 +144,7 @@ class kt extends client_service { } private function _processListing($listing, $type, $arr) { - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' ); + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' ); $result = array (); $methodToIncludeItem = '_processItemInclusion_' . $type; @@ -244,12 +244,12 @@ class kt extends client_service { } private function _processItemInclusion_folderContents($item, $class, $qtip) { - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' ); + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' ); return array ('text' => htmlspecialchars ( $item ['title'] ), 'originaltext' => $item ['title'], 'id' => ($item ['item_type'] == 'F' ? $item ['item_type'] . "_" : "") . $item ['id'], 'filename' => $item ['filename'], 'cls' => $class, 'leaf' => ($item ['item_type'] == 'D'), 'document_type' => $item ['document_type'], 'item_type' => $item ['item_type'], 'permissions' => $item ['permissions'], 'content_id' => $item ['content_id'], 'checked_out_by' => $item ['checked_out_by'], 'qtip' => $qtip ); } private function _processItemInclusion_search($item, $class, $qtip) { - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' ); + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' ); if ($item ['filesize'] == 'n/a') { $item ['filesize'] = - 1; } @@ -257,7 +257,7 @@ class kt extends client_service { } private function _processItemInclusion_grid($item, $class, $qtip) { - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' ); + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' ); //var_dump($item); @@ -269,7 +269,7 @@ class kt extends client_service { } public function get_metadata($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; if (substr ( $params ['document_id'], 0, 2 ) == 'D_') { @@ -351,7 +351,7 @@ class kt extends client_service { } public function get_documenttypes($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; @@ -394,7 +394,7 @@ class kt extends client_service { * @param unknown_type $params */ function download_document($params, $returnResult = false){ - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $params ['session_id'] = $params ['session_id'] ? $params ['session_id'] : $this->AuthInfo ['session']; @@ -461,7 +461,7 @@ class kt extends client_service { * @param unknown_type $params */ public function download_multiple_documents($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $response = array (); foreach ( $params ['documents'] as $docId ) { $ret = $this->download_document ( array ('document_id' => $docId, 'app_type' => $params ['app_type'], 'multipart' => $params ['multipart'] ), true ); @@ -483,7 +483,7 @@ class kt extends client_service { * */ function checkout_document($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $responseType = 'kt_response'; $kt = &$this->KT; @@ -523,7 +523,7 @@ class kt extends client_service { * @param array $params */ function checkin_document($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $session_id = $this->AuthInfo ['session']; $document_id = $params ['document_id']; $filename = $params ['filename']; @@ -569,7 +569,7 @@ class kt extends client_service { * @param unknown_type $arr */ function add_document_with_metadata($arr) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $session_id = $arr ['session_id']; //error_reporting(E_ALL); $metadata = array (); @@ -625,7 +625,7 @@ class kt extends client_service { } function create_empty_upload_file($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $config = KTConfig::getSingleton (); $this->addDebug ( 'KTConfig Singleton', $config ); $uploadFolder = $config->get ( 'webservice/uploadDirectory' ); @@ -645,7 +645,7 @@ class kt extends client_service { } function get_all_client_policies() { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $config = KTConfig::getSingleton (); $this->addDebug ( 'KTConfig Singleton', $config ); @@ -675,7 +675,7 @@ class kt extends client_service { } function get_all_explorer_policies() { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $config = KTConfig::getSingleton (); $this->addDebug ( 'KTConfig Singleton', $config ); @@ -707,12 +707,12 @@ class kt extends client_service { } public function switchlang($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); setcookie ( "kt_language", $params ['lang'], 2147483647, '/' ); } function add_document_params($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $folder_id = $params ['folder_id']; $title = $params ['title']; $filename = $params ['filename']; @@ -757,7 +757,7 @@ class kt extends client_service { } function delete_document($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $session_id = $params ['session_id']; $document_id = $params ['document_id']; $reason = $params ['reason']; @@ -783,7 +783,7 @@ class kt extends client_service { } private function update_document_metadata($session_id, $document_id, $metadata, $application, $sysdata = null) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $this->addDebug ( 'update_document_metadata', 'entered update_document_metadata' ); $kt = &$this->KT; $responseType = 'kt_document_detail'; @@ -807,7 +807,7 @@ class kt extends client_service { } function get_client_policy($arr) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $policy_name = $arr ['policy_name']; $config = KTConfig::getSingleton (); @@ -823,7 +823,7 @@ class kt extends client_service { } function search($arr) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $listing = processSearchExpression ( "(GeneralText contains \"" . $arr ['query'] . "\")" ); @@ -843,7 +843,7 @@ class kt extends client_service { } public function update_metadata($arr) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $metadata = array (); $meta = $arr ['metadata']; @@ -928,7 +928,7 @@ Fatal error: Cannot unset string offsets in on line 981 } function check_document_title($arr) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $folder = $kt->get_folder_by_id ( $arr ['folder_id'] ); @@ -948,7 +948,7 @@ Fatal error: Cannot unset string offsets in on line 981 } function cancel_checkout($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $document = &$kt->get_document_by_id ( $params ['document_id'] ); @@ -967,7 +967,7 @@ Fatal error: Cannot unset string offsets in on line 981 } function get_transaction_history($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $document = &$kt->get_document_by_id ( $params ['document_id'] ); @@ -985,7 +985,7 @@ Fatal error: Cannot unset string offsets in on line 981 } public function get_users_groups($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $query = $params ['query']; //$start=$params['start']; @@ -1013,7 +1013,7 @@ Fatal error: Cannot unset string offsets in on line 981 } function send_email($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $message = $params ['message']; @@ -1066,7 +1066,7 @@ Fatal error: Cannot unset string offsets in on line 981 } function is_latest_version($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $documentId = $params ['document_id']; @@ -1079,7 +1079,7 @@ Fatal error: Cannot unset string offsets in on line 981 } function check_permission($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $user = $kt->get_user (); @@ -1096,7 +1096,7 @@ Fatal error: Cannot unset string offsets in on line 981 } function copydocument($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $response = $kt->copy_document ( $params ['documentid'], $params ['destfolderid'], $params ['reason'] ); @@ -1110,7 +1110,7 @@ Fatal error: Cannot unset string offsets in on line 981 } function movedocument($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = $this->KT; $response = $kt->move_document ( $params ['documentid'], $params ['destfolderid'], $params ['reason'] ); @@ -1125,7 +1125,7 @@ Fatal error: Cannot unset string offsets in on line 981 } function copyfolder($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $response = $kt->copy_folder ( $params ['sourcefolderid'], $params ['destfolderid'], $params ['reason'] ); @@ -1140,7 +1140,7 @@ Fatal error: Cannot unset string offsets in on line 981 } function movefolder($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $response = $kt->move_folder ( $params ['sourcefolderid'], $params ['destfolderid'], $params ['reason'] ); @@ -1154,7 +1154,7 @@ Fatal error: Cannot unset string offsets in on line 981 } function renamefolder($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $response = $kt->rename_folder ( $params ['currentfolderid'], $params ['newname'] ); @@ -1168,7 +1168,7 @@ Fatal error: Cannot unset string offsets in on line 981 } function addfolder($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $this->addDebug ( 'parameters', $params ); $response = $kt->create_folder ( $params ['currentfolderid'], $params ['newname'] ); @@ -1177,7 +1177,7 @@ Fatal error: Cannot unset string offsets in on line 981 } function deletefolder($params) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $response = $kt->delete_folder ( $params ['folderid'], $params ['reason'] ); @@ -1191,7 +1191,7 @@ Fatal error: Cannot unset string offsets in on line 981 } function candeletefolder($arr) { - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $kt = &$this->KT; $folder = &$kt->get_folder_by_id ( $arr ['folderid'] ); diff --git a/webservice/clienttools/services/0.9/server.php b/webservice/clienttools/services/0.9/server.php index 5200d06..244d0e9 100644 --- a/webservice/clienttools/services/0.9/server.php +++ b/webservice/clienttools/services/0.9/server.php @@ -1,22 +1,22 @@ logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $this->setResponse(array('online'=>true)); } public function ping(){ - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $this->addResponse('pong',time()); } public function getToken(){ - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); } public function phpInfo(){ - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); ob_start(); phpinfo(); $this->addResponse('phpinfo',ob_get_clean()); diff --git a/webservice/clienttools/standardservices/system.php b/webservice/clienttools/standardservices/system.php index 58187e2..5db8abd 100644 --- a/webservice/clienttools/standardservices/system.php +++ b/webservice/clienttools/standardservices/system.php @@ -1,7 +1,7 @@ logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); global $default; $user=$this->KT->get_user_object_by_username($this->AuthInfo['user']); $versions=$this->handler->getServerVersions(); @@ -20,14 +20,14 @@ class system extends client_service{ ); $this->setResponse($ret); - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Exit Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Exit Function'); return true; } public function jsondecode($params){ - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function'); $this->setResponse(@json_decode(trim($params['code']))); - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Exit Function'); + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Exit Function'); } }