Commit 182ef4adb126af902745840d53ad0e4138265d52

Authored by Jarrett Jordaan
2 parents c5264209 8223b21b

Merge branch 'edge' of git@github.com:ktgit/knowledgetree into edge

webservice/clienttools/clienttools_syslog.php
... ... @@ -7,6 +7,12 @@ class Clienttools_Syslog{
7 7 private static $errorLogTemplate='[date] | [time] | ERROR | [session] | [user] | [location] | [error_detail] | ([error])';
8 8  
9 9  
  10 + /**
  11 + * Parse an array into a string template
  12 + * @param $template The template string - array keys in square brackets : [date] | [time] | ERROR | [session] | [user] | [location] | [error_detail] | ([error])
  13 + * @param $data The associative array to parse into template. Keys will replace [keys] in template string.
  14 + * @return string The parsed template string
  15 + */
10 16 private static function parseTemplate($template=NULL,$data=NULL){
11 17 $ret=null;
12 18 if(is_array($data)){
... ... @@ -17,7 +23,6 @@ class Clienttools_Syslog{
17 23 $txd=array_values($data);
18 24 $ret=str_replace($txs,$txd,$template);
19 25 };
20   -// echo print_r(Array('s'=>$txs,'d'=>$txd),true)."\n\n\n\n\n\n";
21 26 return $ret;
22 27 }
23 28  
... ... @@ -32,8 +37,12 @@ class Clienttools_Syslog{
32 37 }
33 38  
34 39  
  40 + /**
  41 + * Write a line to the log file.
  42 + * @param $line
  43 + * @return void
  44 + */
35 45 private static function writeLogLine($line=NULL){
36   -// echo('LOGFILE: '.realpath(self::getLogFile()));
37 46 if($line){
38 47 $fp=fopen(self::getLogFile(),'a');
39 48 fwrite($fp,$line."\n");
... ... @@ -46,7 +55,6 @@ class Clienttools_Syslog{
46 55 * @return boolean
47 56 */
48 57 private static function doErrorLogging(){
49   -// $GLOBALS['default']['debugLevel']; //Another less secure way of finding the configured debugLevel
50 58 return KTConfig::getSingleton()->get('explorerCPSettings/debugLevel')=='error' || self::doDebugLogging();
51 59 }
52 60  
... ... @@ -58,51 +66,80 @@ class Clienttools_Syslog{
58 66 return KTConfig::getSingleton()->get('explorerCPSettings/debugLevel')=='debug';
59 67 }
60 68  
  69 + /**
  70 + * Store a line in the log file.. the message and a json string containing the data information will be stored
  71 + * @param $user The logged in user
  72 + * @param $location Information about the location from whence the function was called
  73 + * @param $message The descriptive message explaining the debug data that follows
  74 + * @param $data The debug data - this will be converted to a json string.
  75 + * @return void
  76 + */
61 77 public static function logInfo($user,$location,$message,$data){
62   - list($usec, $sec) = explode(" ", microtime());
63   - $usec=ceil($usec*1000);
64   - $entry=self::parseTemplate(self::$debugLogTemplate,array(
65   - 'date' =>date('Y-m-d'),
66   - 'time' =>date('h:i:s').':'.$usec,
67   - 'user' =>$user,
68   - 'session'=>session_id(),
69   - 'location'=>$location,
70   - 'debug_message'=>$message,
71   - 'debug_data'=>json_encode($data)
72   - ));
73   -
74   - self::writeLogLine($entry);
  78 + if(self::doDebugLogging()){
  79 + list($usec, $sec) = explode(" ", microtime());
  80 + $usec=ceil($usec*1000);
  81 + $entry=self::parseTemplate(self::$debugLogTemplate,array(
  82 + 'date' =>date('Y-m-d'),
  83 + 'time' =>date('h:i:s').':'.$usec,
  84 + 'user' =>$user,
  85 + 'session'=>session_id(),
  86 + 'location'=>$location,
  87 + 'debug_message'=>$message,
  88 + 'debug_data'=>json_encode($data)
  89 + ));
  90 +
  91 + self::writeLogLine($entry);
  92 + }
75 93 }
76 94  
  95 + /**
  96 + * Store a line in the log file.. A simple string to indicate a point in the software
  97 + * @param $user The logged in user
  98 + * @param $location Information about the location from whence the function was called
  99 + * @param $message A string indicating a point reached in the software
  100 + * @return void
  101 + */
77 102 public static function logTrace($user,$location,$message){
78   - list($usec, $sec) = explode(" ", microtime());
79   - $usec=ceil($usec*1000);
80   - $entry=self::parseTemplate(self::$traceLogTemplate,array(
81   - 'date' =>date('Y-m-d'),
82   - 'time' =>date('h:i:s').':'.$usec,
83   - 'user' =>$user,
84   - 'session'=>session_id(),
85   - 'location'=>$location,
86   - 'trace_message'=>$message,
87   - ));
88   -
89   - self::writeLogLine($entry);
  103 + if(self::doDebugLogging()){
  104 + list($usec, $sec) = explode(" ", microtime());
  105 + $usec=ceil($usec*1000);
  106 + $entry=self::parseTemplate(self::$traceLogTemplate,array(
  107 + 'date' =>date('Y-m-d'),
  108 + 'time' =>date('h:i:s').':'.$usec,
  109 + 'user' =>$user,
  110 + 'session'=>session_id(),
  111 + 'location'=>$location,
  112 + 'trace_message'=>$message,
  113 + ));
  114 +
  115 + self::writeLogLine($entry);
  116 + }
90 117 }
91 118  
  119 + /**
  120 + * Store a line in the log file.. An Error log
  121 + * @param $user The logged in user
  122 + * @param $location Information about the location from whence the function was called
  123 + * @param $detail A string providing information as to the context of the encountered error
  124 + * @param $err The exception object - this will be serialized
  125 + * @return void
  126 + */
92 127 public static function logError($user=NULL,$location=NULL,$detail=NULL,$err=NULL){
93   - list($usec, $sec) = explode(" ", microtime());
94   - $usec=ceil($usec*1000);
95   - $entry=self::parseTemplate(self::$errorLogTemplate,array(
96   - 'date' =>date('Y-m-d'),
97   - 'time' =>date('h:i:s').':'.$usec,
98   - 'user' =>$user,
99   - 'session'=>session_id(),
100   - 'location'=>$location,
101   - 'error_detail'=>json_encode($detail),
102   - 'error'=>json_encode($err),
103   - ));
104   -
105   - self::writeLogLine($entry);
  128 + if(self::doErrorLogging()){
  129 + list($usec, $sec) = explode(" ", microtime());
  130 + $usec=ceil($usec*1000);
  131 + $entry=self::parseTemplate(self::$errorLogTemplate,array(
  132 + 'date' =>date('Y-m-d'),
  133 + 'time' =>date('h:i:s').':'.$usec,
  134 + 'user' =>$user,
  135 + 'session'=>session_id(),
  136 + 'location'=>$location,
  137 + 'error_detail'=>json_encode($detail),
  138 + 'error'=>json_encode($err),
  139 + ));
  140 +
  141 + self::writeLogLine($entry);
  142 + }
106 143  
107 144 }
108 145 }
... ...
webservice/clienttools/services/0.9/auth.php
... ... @@ -3,7 +3,7 @@
3 3 class auth extends client_service {
4 4  
5 5 public function login(){
6   - $this->logTrace((__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
  6 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
7 7 $params=$this->AuthInfo;
8 8  
9 9 $username=$params['user'];
... ... @@ -72,7 +72,7 @@ class auth extends client_service {
72 72 }
73 73  
74 74 public function japiLogin(){
75   - $this->logTrace((__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
  75 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
76 76 global $default;
77 77  
78 78 $user=$this->KT->get_user_object_by_username($this->AuthInfo['user']);
... ... @@ -84,7 +84,7 @@ class auth extends client_service {
84 84 }
85 85  
86 86 public function pickup_session(){
87   - $this->logTrace((__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
  87 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
88 88 $params=$this->AuthInfo;
89 89 $app_type=$params['appType'];
90 90 $session_id=$params['session'];
... ... @@ -101,7 +101,7 @@ class auth extends client_service {
101 101  
102 102  
103 103 public function ping(){
104   - $this->logTrace((__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
  104 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
105 105 global $default;
106 106 $user=$this->KT->get_user_object_by_username($this->AuthInfo['user']);
107 107 $versions=$this->handler->getServerVersions();
... ... @@ -124,19 +124,19 @@ class auth extends client_service {
124 124 }
125 125  
126 126 function logout($params){
127   - $this->logTrace((__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
  127 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
128 128 $params=$this->AuthInfo;
129 129 $app_type=$params['appType'];
130 130 $session_id=$params['session'];
131 131 $ip=$_SERVER['REMOTE_ADDR'];
132 132  
133 133 $session=$this->KT->get_session();
134   - $this->logInfo((__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Logout Session Object (From KT)',$session);
  134 + $this->logInfo((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Logout Session Object (From KT)',$session);
135 135  
136 136 if(get_class($session)!='KTAPI_UserSession'){
137 137 $session = $this->KT->get_active_session($session_id, $ip, $app_type);
138 138 }
139   - $this->logInfo((__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Logout Session Object (To Logout)',$session);
  139 + $this->logInfo((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Logout Session Object (To Logout)',$session);
140 140  
141 141 if (PEAR::isError($session)){
142 142 return false;
... ...
webservice/clienttools/services/0.9/kt.php
... ... @@ -8,7 +8,7 @@ class kt extends client_service {
8 8 *
9 9 */
10 10 function get_languages($passthru = false) {
11   - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' );
  11 + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' );
12 12 global $default;
13 13 $oReg = & KTi18nregistry::getSingleton ();
14 14 $aRegisteredLangs = $oReg->geti18nLanguages ( 'knowledgeTree' );
... ... @@ -28,13 +28,13 @@ class kt extends client_service {
28 28 }
29 29  
30 30 function get_rootfolder_detail($params) {
31   - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' );
  31 + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' );
32 32 $params ['folderId'] = '1';
33 33 $this->get_folder_detail ( $params );
34 34 }
35 35  
36 36 function get_folder_detail($params) {
37   - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' );
  37 + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' );
38 38 if (isset ( $params ['node'] ) && ! isset ( $params ['folderId'] )) {
39 39 $params ['node'] = split ( '_', $params ['node'] );
40 40 $params ['folderId'] = $params ['node'] [1];
... ... @@ -94,7 +94,7 @@ class kt extends client_service {
94 94 }
95 95  
96 96 function get_folder_contents($params) {
97   - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' );
  97 + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' );
98 98 $kt = &$this->KT;
99 99  
100 100 $params ['control'] = 'F_';
... ... @@ -119,7 +119,7 @@ class kt extends client_service {
119 119 * @return array
120 120 */
121 121 function get_folder_contents_for_grid($arr) {
122   - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' );
  122 + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' );
123 123 $kt = &$this->KT;
124 124  
125 125 $arr ['control'] = 'F_';
... ... @@ -144,7 +144,7 @@ class kt extends client_service {
144 144 }
145 145  
146 146 private function _processListing($listing, $type, $arr) {
147   - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' );
  147 + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' );
148 148 $result = array ();
149 149 $methodToIncludeItem = '_processItemInclusion_' . $type;
150 150  
... ... @@ -244,12 +244,12 @@ class kt extends client_service {
244 244 }
245 245  
246 246 private function _processItemInclusion_folderContents($item, $class, $qtip) {
247   - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' );
  247 + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' );
248 248 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 );
249 249 }
250 250  
251 251 private function _processItemInclusion_search($item, $class, $qtip) {
252   - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' );
  252 + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' );
253 253 if ($item ['filesize'] == 'n/a') {
254 254 $item ['filesize'] = - 1;
255 255 }
... ... @@ -257,7 +257,7 @@ class kt extends client_service {
257 257 }
258 258  
259 259 private function _processItemInclusion_grid($item, $class, $qtip) {
260   - $this->logTrace ( __CLASS__ . '::' . __METHOD__ . '(' . __FILE__ . ' ' . __LINE__, 'Enter Function' );
  260 + $this->logTrace ((__METHOD__.'('.__FILE__.' '.__LINE__.')'), 'Enter Function' );
261 261 //var_dump($item);
262 262  
263 263  
... ... @@ -269,7 +269,7 @@ class kt extends client_service {
269 269 }
270 270  
271 271 public function get_metadata($params) {
272   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  272 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
273 273 $kt = &$this->KT;
274 274  
275 275 if (substr ( $params ['document_id'], 0, 2 ) == 'D_') {
... ... @@ -351,7 +351,7 @@ class kt extends client_service {
351 351 }
352 352  
353 353 public function get_documenttypes($params) {
354   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  354 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
355 355  
356 356 $kt = &$this->KT;
357 357  
... ... @@ -394,7 +394,7 @@ class kt extends client_service {
394 394 * @param unknown_type $params
395 395 */
396 396 function download_document($params, $returnResult = false){
397   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  397 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
398 398  
399 399 $kt = &$this->KT;
400 400 $params ['session_id'] = $params ['session_id'] ? $params ['session_id'] : $this->AuthInfo ['session'];
... ... @@ -461,7 +461,7 @@ class kt extends client_service {
461 461 * @param unknown_type $params
462 462 */
463 463 public function download_multiple_documents($params) {
464   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  464 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
465 465 $response = array ();
466 466 foreach ( $params ['documents'] as $docId ) {
467 467 $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 {
483 483 *
484 484 */
485 485 function checkout_document($params) {
486   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  486 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
487 487 $responseType = 'kt_response';
488 488 $kt = &$this->KT;
489 489  
... ... @@ -523,7 +523,7 @@ class kt extends client_service {
523 523 * @param array $params
524 524 */
525 525 function checkin_document($params) {
526   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  526 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
527 527 $session_id = $this->AuthInfo ['session'];
528 528 $document_id = $params ['document_id'];
529 529 $filename = $params ['filename'];
... ... @@ -569,7 +569,7 @@ class kt extends client_service {
569 569 * @param unknown_type $arr
570 570 */
571 571 function add_document_with_metadata($arr) {
572   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  572 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
573 573 $session_id = $arr ['session_id'];
574 574 //error_reporting(E_ALL);
575 575 $metadata = array ();
... ... @@ -625,7 +625,7 @@ class kt extends client_service {
625 625 }
626 626  
627 627 function create_empty_upload_file($params) {
628   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  628 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
629 629 $config = KTConfig::getSingleton ();
630 630 $this->addDebug ( 'KTConfig Singleton', $config );
631 631 $uploadFolder = $config->get ( 'webservice/uploadDirectory' );
... ... @@ -645,7 +645,7 @@ class kt extends client_service {
645 645 }
646 646  
647 647 function get_all_client_policies() {
648   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  648 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
649 649 $config = KTConfig::getSingleton ();
650 650 $this->addDebug ( 'KTConfig Singleton', $config );
651 651  
... ... @@ -675,7 +675,7 @@ class kt extends client_service {
675 675 }
676 676  
677 677 function get_all_explorer_policies() {
678   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  678 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
679 679 $config = KTConfig::getSingleton ();
680 680 $this->addDebug ( 'KTConfig Singleton', $config );
681 681  
... ... @@ -707,12 +707,12 @@ class kt extends client_service {
707 707 }
708 708  
709 709 public function switchlang($params) {
710   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  710 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
711 711 setcookie ( "kt_language", $params ['lang'], 2147483647, '/' );
712 712 }
713 713  
714 714 function add_document_params($params) {
715   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  715 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
716 716 $folder_id = $params ['folder_id'];
717 717 $title = $params ['title'];
718 718 $filename = $params ['filename'];
... ... @@ -757,7 +757,7 @@ class kt extends client_service {
757 757 }
758 758  
759 759 function delete_document($params) {
760   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  760 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
761 761 $session_id = $params ['session_id'];
762 762 $document_id = $params ['document_id'];
763 763 $reason = $params ['reason'];
... ... @@ -783,7 +783,7 @@ class kt extends client_service {
783 783 }
784 784  
785 785 private function update_document_metadata($session_id, $document_id, $metadata, $application, $sysdata = null) {
786   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  786 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
787 787 $this->addDebug ( 'update_document_metadata', 'entered update_document_metadata' );
788 788 $kt = &$this->KT;
789 789 $responseType = 'kt_document_detail';
... ... @@ -807,7 +807,7 @@ class kt extends client_service {
807 807 }
808 808  
809 809 function get_client_policy($arr) {
810   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  810 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
811 811 $policy_name = $arr ['policy_name'];
812 812  
813 813 $config = KTConfig::getSingleton ();
... ... @@ -823,7 +823,7 @@ class kt extends client_service {
823 823 }
824 824  
825 825 function search($arr) {
826   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  826 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
827 827 $kt = &$this->KT;
828 828  
829 829 $listing = processSearchExpression ( "(GeneralText contains \"" . $arr ['query'] . "\")" );
... ... @@ -843,7 +843,7 @@ class kt extends client_service {
843 843 }
844 844  
845 845 public function update_metadata($arr) {
846   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  846 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
847 847 $metadata = array ();
848 848 $meta = $arr ['metadata'];
849 849  
... ... @@ -928,7 +928,7 @@ Fatal error: Cannot unset string offsets in on line 981
928 928 }
929 929  
930 930 function check_document_title($arr) {
931   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  931 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
932 932 $kt = &$this->KT;
933 933  
934 934 $folder = $kt->get_folder_by_id ( $arr ['folder_id'] );
... ... @@ -948,7 +948,7 @@ Fatal error: Cannot unset string offsets in on line 981
948 948 }
949 949  
950 950 function cancel_checkout($params) {
951   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  951 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
952 952 $kt = &$this->KT;
953 953  
954 954 $document = &$kt->get_document_by_id ( $params ['document_id'] );
... ... @@ -967,7 +967,7 @@ Fatal error: Cannot unset string offsets in on line 981
967 967 }
968 968  
969 969 function get_transaction_history($params) {
970   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  970 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
971 971 $kt = &$this->KT;
972 972  
973 973 $document = &$kt->get_document_by_id ( $params ['document_id'] );
... ... @@ -985,7 +985,7 @@ Fatal error: Cannot unset string offsets in on line 981
985 985 }
986 986  
987 987 public function get_users_groups($params) {
988   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  988 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
989 989 $kt = &$this->KT;
990 990 $query = $params ['query'];
991 991 //$start=$params['start'];
... ... @@ -1013,7 +1013,7 @@ Fatal error: Cannot unset string offsets in on line 981
1013 1013 }
1014 1014  
1015 1015 function send_email($params) {
1016   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  1016 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
1017 1017 $kt = &$this->KT;
1018 1018  
1019 1019 $message = $params ['message'];
... ... @@ -1066,7 +1066,7 @@ Fatal error: Cannot unset string offsets in on line 981
1066 1066 }
1067 1067  
1068 1068 function is_latest_version($params) {
1069   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  1069 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
1070 1070 $kt = &$this->KT;
1071 1071  
1072 1072 $documentId = $params ['document_id'];
... ... @@ -1079,7 +1079,7 @@ Fatal error: Cannot unset string offsets in on line 981
1079 1079 }
1080 1080  
1081 1081 function check_permission($params) {
1082   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  1082 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
1083 1083 $kt = &$this->KT;
1084 1084  
1085 1085 $user = $kt->get_user ();
... ... @@ -1096,7 +1096,7 @@ Fatal error: Cannot unset string offsets in on line 981
1096 1096 }
1097 1097  
1098 1098 function copydocument($params) {
1099   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  1099 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
1100 1100 $kt = &$this->KT;
1101 1101  
1102 1102 $response = $kt->copy_document ( $params ['documentid'], $params ['destfolderid'], $params ['reason'] );
... ... @@ -1110,7 +1110,7 @@ Fatal error: Cannot unset string offsets in on line 981
1110 1110 }
1111 1111  
1112 1112 function movedocument($params) {
1113   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  1113 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
1114 1114 $kt = $this->KT;
1115 1115  
1116 1116 $response = $kt->move_document ( $params ['documentid'], $params ['destfolderid'], $params ['reason'] );
... ... @@ -1125,7 +1125,7 @@ Fatal error: Cannot unset string offsets in on line 981
1125 1125 }
1126 1126  
1127 1127 function copyfolder($params) {
1128   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  1128 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
1129 1129 $kt = &$this->KT;
1130 1130  
1131 1131 $response = $kt->copy_folder ( $params ['sourcefolderid'], $params ['destfolderid'], $params ['reason'] );
... ... @@ -1140,7 +1140,7 @@ Fatal error: Cannot unset string offsets in on line 981
1140 1140 }
1141 1141  
1142 1142 function movefolder($params) {
1143   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  1143 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
1144 1144 $kt = &$this->KT;
1145 1145  
1146 1146 $response = $kt->move_folder ( $params ['sourcefolderid'], $params ['destfolderid'], $params ['reason'] );
... ... @@ -1154,7 +1154,7 @@ Fatal error: Cannot unset string offsets in on line 981
1154 1154 }
1155 1155  
1156 1156 function renamefolder($params) {
1157   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  1157 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
1158 1158 $kt = &$this->KT;
1159 1159  
1160 1160 $response = $kt->rename_folder ( $params ['currentfolderid'], $params ['newname'] );
... ... @@ -1168,7 +1168,7 @@ Fatal error: Cannot unset string offsets in on line 981
1168 1168 }
1169 1169  
1170 1170 function addfolder($params) {
1171   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  1171 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
1172 1172 $kt = &$this->KT;
1173 1173 $this->addDebug ( 'parameters', $params );
1174 1174 $response = $kt->create_folder ( $params ['currentfolderid'], $params ['newname'] );
... ... @@ -1177,7 +1177,7 @@ Fatal error: Cannot unset string offsets in on line 981
1177 1177 }
1178 1178  
1179 1179 function deletefolder($params) {
1180   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  1180 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
1181 1181 $kt = &$this->KT;
1182 1182  
1183 1183 $response = $kt->delete_folder ( $params ['folderid'], $params ['reason'] );
... ... @@ -1191,7 +1191,7 @@ Fatal error: Cannot unset string offsets in on line 981
1191 1191 }
1192 1192  
1193 1193 function candeletefolder($arr) {
1194   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  1194 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
1195 1195 $kt = &$this->KT;
1196 1196  
1197 1197 $folder = &$kt->get_folder_by_id ( $arr ['folderid'] );
... ...
webservice/clienttools/services/0.9/server.php
1 1 <?php
2 2 class server extends client_service {
3 3 public function status(){
4   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  4 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
5 5 $this->setResponse(array('online'=>true));
6 6 }
7 7  
8 8 public function ping(){
9   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  9 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
10 10 $this->addResponse('pong',time());
11 11 }
12 12  
13 13 public function getToken(){
14   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  14 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
15 15  
16 16 }
17 17  
18 18 public function phpInfo(){
19   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  19 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
20 20 ob_start();
21 21 phpinfo();
22 22 $this->addResponse('phpinfo',ob_get_clean());
... ...
webservice/clienttools/standardservices/system.php
1 1 <?php
2 2 class system extends client_service{
3 3 public function checkVersion(){
4   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  4 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
5 5 global $default;
6 6 $user=$this->KT->get_user_object_by_username($this->AuthInfo['user']);
7 7 $versions=$this->handler->getServerVersions();
... ... @@ -20,14 +20,14 @@ class system extends client_service{
20 20  
21 21 );
22 22 $this->setResponse($ret);
23   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Exit Function');
  23 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Exit Function');
24 24 return true;
25 25 }
26 26  
27 27 public function jsondecode($params){
28   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Enter Function');
  28 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Enter Function');
29 29 $this->setResponse(@json_decode(trim($params['code'])));
30   - $this->logTrace(__CLASS__.'::'.__METHOD__.'('.__FILE__.' '.__LINE__,'Exit Function');
  30 + $this->logTrace((__METHOD__.'('.__FILE__.' '.__LINE__.')'),'Exit Function');
31 31 }
32 32 }
33 33  
... ...