@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $this->me['struct'] = $val; |
97 | 97 | break; |
98 | 98 | default: |
99 | - $this->getLogger()->error("XML-RPC: " . __METHOD__ . ": not a known type ($type)"); |
|
99 | + $this->getLogger()->error("XML-RPC: ".__METHOD__.": not a known type ($type)"); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | if ($typeOf !== 1) { |
129 | - $this->getLogger()->error("XML-RPC: " . __METHOD__ . ": not a scalar type ($type)"); |
|
129 | + $this->getLogger()->error("XML-RPC: ".__METHOD__.": not a scalar type ($type)"); |
|
130 | 130 | return 0; |
131 | 131 | } |
132 | 132 | |
@@ -143,10 +143,10 @@ discard block |
||
143 | 143 | |
144 | 144 | switch ($this->mytype) { |
145 | 145 | case 1: |
146 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': scalar xmlrpc value can have only one value'); |
|
146 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': scalar xmlrpc value can have only one value'); |
|
147 | 147 | return 0; |
148 | 148 | case 3: |
149 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': cannot add anonymous scalar to struct xmlrpc value'); |
|
149 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': cannot add anonymous scalar to struct xmlrpc value'); |
|
150 | 150 | return 0; |
151 | 151 | case 2: |
152 | 152 | // we're adding a scalar value to an array here |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | |
191 | 191 | return 1; |
192 | 192 | } else { |
193 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']'); |
|
193 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']'); |
|
194 | 194 | return 0; |
195 | 195 | } |
196 | 196 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | |
222 | 222 | return 1; |
223 | 223 | } else { |
224 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']'); |
|
224 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']'); |
|
225 | 225 | return 0; |
226 | 226 | } |
227 | 227 | } |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | $val = reset($this->me); |
287 | 287 | $typ = key($this->me); |
288 | 288 | |
289 | - return '<value>' . $this->serializeData($typ, $val, $charsetEncoding) . "</value>\n"; |
|
289 | + return '<value>'.$this->serializeData($typ, $val, $charsetEncoding)."</value>\n"; |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | /** |
@@ -309,19 +309,19 @@ discard block |
||
309 | 309 | case 1: |
310 | 310 | switch ($typ) { |
311 | 311 | case static::$xmlrpcBase64: |
312 | - $rs = "<{$typ}>" . base64_encode($val) . "</{$typ}>"; |
|
312 | + $rs = "<{$typ}>".base64_encode($val)."</{$typ}>"; |
|
313 | 313 | break; |
314 | 314 | case static::$xmlrpcBoolean: |
315 | - $rs = "<{$typ}>" . ($val ? '1' : '0') . "</{$typ}>"; |
|
315 | + $rs = "<{$typ}>".($val ? '1' : '0')."</{$typ}>"; |
|
316 | 316 | break; |
317 | 317 | case static::$xmlrpcString: |
318 | 318 | // Do NOT use htmlentities, since it will produce named html entities, which are invalid xml |
319 | - $rs = "<{$typ}>" . $this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</{$typ}>"; |
|
319 | + $rs = "<{$typ}>".$this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</{$typ}>"; |
|
320 | 320 | break; |
321 | 321 | case static::$xmlrpcInt: |
322 | 322 | case static::$xmlrpcI4: |
323 | 323 | case static::$xmlrpcI8: |
324 | - $rs = "<{$typ}>" . (int)$val . "</{$typ}>"; |
|
324 | + $rs = "<{$typ}>".(int) $val."</{$typ}>"; |
|
325 | 325 | break; |
326 | 326 | case static::$xmlrpcDouble: |
327 | 327 | // avoid using standard conversion of float to string because it is locale-dependent, |
@@ -329,16 +329,16 @@ discard block |
||
329 | 329 | // sprintf('%F') could be most likely ok, but it fails e.g. on 2e-14. |
330 | 330 | // The code below tries its best at keeping max precision while avoiding exp notation, |
331 | 331 | // but there is of course no limit in the number of decimal places to be used... |
332 | - $rs = "<{$typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, PhpXmlRpc::$xmlpc_double_precision, '.', '')) . "</{$typ}>"; |
|
332 | + $rs = "<{$typ}>".preg_replace('/\\.?0+$/', '', number_format((double) $val, PhpXmlRpc::$xmlpc_double_precision, '.', ''))."</{$typ}>"; |
|
333 | 333 | break; |
334 | 334 | case static::$xmlrpcDateTime: |
335 | 335 | if (is_string($val)) { |
336 | 336 | $rs = "<{$typ}>{$val}</{$typ}>"; |
337 | 337 | // DateTimeInterface is not present in php 5.4... |
338 | 338 | } elseif (is_a($val, 'DateTimeInterface') || is_a($val, 'DateTime')) { |
339 | - $rs = "<{$typ}>" . $val->format('Ymd\TH:i:s') . "</{$typ}>"; |
|
339 | + $rs = "<{$typ}>".$val->format('Ymd\TH:i:s')."</{$typ}>"; |
|
340 | 340 | } elseif (is_int($val)) { |
341 | - $rs = "<{$typ}>" . date('Ymd\TH:i:s', $val) . "</{$typ}>"; |
|
341 | + $rs = "<{$typ}>".date('Ymd\TH:i:s', $val)."</{$typ}>"; |
|
342 | 342 | } else { |
343 | 343 | // not really a good idea here: but what should we output anyway? left for backward compat... |
344 | 344 | $rs = "<{$typ}>{$val}</{$typ}>"; |
@@ -360,14 +360,14 @@ discard block |
||
360 | 360 | case 3: |
361 | 361 | // struct |
362 | 362 | if ($this->_php_class) { |
363 | - $rs = '<struct php_class="' . $this->_php_class . "\">\n"; |
|
363 | + $rs = '<struct php_class="'.$this->_php_class."\">\n"; |
|
364 | 364 | } else { |
365 | 365 | $rs = "<struct>\n"; |
366 | 366 | } |
367 | 367 | $charsetEncoder = $this->getCharsetEncoder(); |
368 | 368 | /** @var Value $val2 */ |
369 | 369 | foreach ($val as $key2 => $val2) { |
370 | - $rs .= '<member><name>' . $charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</name>\n"; |
|
370 | + $rs .= '<member><name>'.$charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</name>\n"; |
|
371 | 371 | $rs .= $val2->serialize($charsetEncoding); |
372 | 372 | $rs .= "</member>\n"; |
373 | 373 | } |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | */ |
582 | 582 | public function structMemExists($key) |
583 | 583 | { |
584 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
584 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
585 | 585 | |
586 | 586 | return array_key_exists($key, $this->me['struct']); |
587 | 587 | } |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | */ |
598 | 598 | public function structMem($key) |
599 | 599 | { |
600 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
600 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
601 | 601 | |
602 | 602 | return $this->me['struct'][$key]; |
603 | 603 | } |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | */ |
611 | 611 | public function structReset() |
612 | 612 | { |
613 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
613 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
614 | 614 | |
615 | 615 | reset($this->me['struct']); |
616 | 616 | } |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | */ |
625 | 625 | public function structEach() |
626 | 626 | { |
627 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
627 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
628 | 628 | |
629 | 629 | $key = key($this->me['struct']); |
630 | 630 | $value = current($this->me['struct']); |
@@ -643,7 +643,7 @@ discard block |
||
643 | 643 | */ |
644 | 644 | public function arrayMem($key) |
645 | 645 | { |
646 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
646 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
647 | 647 | |
648 | 648 | return $this->me['array'][$key]; |
649 | 649 | } |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | */ |
658 | 658 | public function arraySize() |
659 | 659 | { |
660 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
660 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
661 | 661 | |
662 | 662 | return count($this->me['array']); |
663 | 663 | } |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | */ |
672 | 672 | public function structSize() |
673 | 673 | { |
674 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
674 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
675 | 675 | |
676 | 676 | return count($this->me['struct']); |
677 | 677 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | return true; |
79 | 79 | } else { |
80 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': value passed in must be a PhpXmlRpc\Value'); |
|
80 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': value passed in must be a PhpXmlRpc\Value'); |
|
81 | 81 | return false; |
82 | 82 | } |
83 | 83 | } |
@@ -127,17 +127,17 @@ discard block |
||
127 | 127 | $this->logDeprecationUnlessCalledBy('serialize'); |
128 | 128 | |
129 | 129 | if ($charsetEncoding != '') { |
130 | - $this->content_type = 'text/xml; charset=' . $charsetEncoding; |
|
130 | + $this->content_type = 'text/xml; charset='.$charsetEncoding; |
|
131 | 131 | } else { |
132 | 132 | $this->content_type = 'text/xml'; |
133 | 133 | } |
134 | 134 | |
135 | 135 | $result = $this->xml_header($charsetEncoding); |
136 | - $result .= '<methodName>' . $this->getCharsetEncoder()->encodeEntities( |
|
137 | - $this->methodname, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</methodName>\n"; |
|
136 | + $result .= '<methodName>'.$this->getCharsetEncoder()->encodeEntities( |
|
137 | + $this->methodname, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</methodName>\n"; |
|
138 | 138 | $result .= "<params>\n"; |
139 | 139 | foreach ($this->params as $p) { |
140 | - $result .= "<param>\n" . $p->serialize($charsetEncoding) . |
|
140 | + $result .= "<param>\n".$p->serialize($charsetEncoding). |
|
141 | 141 | "</param>\n"; |
142 | 142 | } |
143 | 143 | $result .= "</params>\n"; |
@@ -157,9 +157,9 @@ discard block |
||
157 | 157 | $this->logDeprecationUnlessCalledBy('createPayload'); |
158 | 158 | |
159 | 159 | if ($charsetEncoding != '') { |
160 | - return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\" ?" . ">\n<methodCall>\n"; |
|
160 | + return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\" ?".">\n<methodCall>\n"; |
|
161 | 161 | } else { |
162 | - return "<?xml version=\"1.0\"?" . ">\n<methodCall>\n"; |
|
162 | + return "<?xml version=\"1.0\"?".">\n<methodCall>\n"; |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 | |
@@ -221,14 +221,14 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function parseResponse($data = '', $headersProcessed = false, $returnType = XMLParser::RETURN_XMLRPCVALS) |
223 | 223 | { |
224 | - if ($this->debug > 0) { |
|
224 | + if ($this->debug>0) { |
|
225 | 225 | $this->getLogger()->debug("---GOT---\n$data\n---END---"); |
226 | 226 | } |
227 | 227 | |
228 | 228 | $this->httpResponse = array('raw_data' => $data, 'headers' => array(), 'cookies' => array()); |
229 | 229 | |
230 | 230 | if ($data == '') { |
231 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': no response received from server.'); |
|
231 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': no response received from server.'); |
|
232 | 232 | return new Response(0, PhpXmlRpc::$xmlrpcerr['no_data'], PhpXmlRpc::$xmlrpcstr['no_data']); |
233 | 233 | } |
234 | 234 | |
@@ -236,12 +236,12 @@ discard block |
||
236 | 236 | if (substr($data, 0, 4) == 'HTTP') { |
237 | 237 | $httpParser = new Http(); |
238 | 238 | try { |
239 | - $httpResponse = $httpParser->parseResponseHeaders($data, $headersProcessed, $this->debug > 0); |
|
239 | + $httpResponse = $httpParser->parseResponseHeaders($data, $headersProcessed, $this->debug>0); |
|
240 | 240 | } catch (HttpException $e) { |
241 | 241 | // failed processing of HTTP response headers |
242 | 242 | // save into response obj the full payload received, for debugging |
243 | 243 | return new Response(0, $e->getCode(), $e->getMessage(), '', array('raw_data' => $data, 'status_code', $e->statusCode())); |
244 | - } catch(\Exception $e) { |
|
244 | + } catch (\Exception $e) { |
|
245 | 245 | return new Response(0, $e->getCode(), $e->getMessage(), '', array('raw_data' => $data)); |
246 | 246 | } |
247 | 247 | } else { |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | // idea from Luca Mariano <[email protected]> originally in PEARified version of the lib |
258 | 258 | $pos = strrpos($data, '</methodResponse>'); |
259 | 259 | if ($pos !== false) { |
260 | - $data = substr($data, 0, $pos + 17); |
|
260 | + $data = substr($data, 0, $pos+17); |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | // try to 'guestimate' the character encoding of the received response |
@@ -266,21 +266,21 @@ discard block |
||
266 | 266 | $data |
267 | 267 | ); |
268 | 268 | |
269 | - if ($this->debug >= 0) { |
|
269 | + if ($this->debug>=0) { |
|
270 | 270 | $this->httpResponse = $httpResponse; |
271 | 271 | } else { |
272 | 272 | $httpResponse = null; |
273 | 273 | } |
274 | 274 | |
275 | - if ($this->debug > 0) { |
|
275 | + if ($this->debug>0) { |
|
276 | 276 | $start = strpos($data, '<!-- SERVER DEBUG INFO (BASE64 ENCODED):'); |
277 | 277 | if ($start) { |
278 | 278 | $start += strlen('<!-- SERVER DEBUG INFO (BASE64 ENCODED):'); |
279 | 279 | /// @todo what if there is no end tag? |
280 | 280 | $end = strpos($data, '-->', $start); |
281 | - $comments = substr($data, $start, $end - $start); |
|
282 | - $this->getLogger()->debug("---SERVER DEBUG INFO (DECODED)---\n\t" . |
|
283 | - str_replace("\n", "\n\t", base64_decode($comments)) . "\n---END---", array('encoding' => $respEncoding)); |
|
281 | + $comments = substr($data, $start, $end-$start); |
|
282 | + $this->getLogger()->debug("---SERVER DEBUG INFO (DECODED)---\n\t". |
|
283 | + str_replace("\n", "\n\t", base64_decode($comments))."\n---END---", array('encoding' => $respEncoding)); |
|
284 | 284 | } |
285 | 285 | } |
286 | 286 | |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | if ($respEncoding == 'ISO-8859-1') { |
303 | 303 | $data = utf8_encode($data); |
304 | 304 | } else { |
305 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': unsupported charset encoding of received response: ' . $respEncoding); |
|
305 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': unsupported charset encoding of received response: '.$respEncoding); |
|
306 | 306 | } |
307 | 307 | } |
308 | 308 | } |
@@ -329,16 +329,16 @@ discard block |
||
329 | 329 | // there could be proxies meddling with the request, or network data corruption... |
330 | 330 | |
331 | 331 | $r = new Response(0, PhpXmlRpc::$xmlrpcerr['invalid_xml'], |
332 | - PhpXmlRpc::$xmlrpcstr['invalid_xml'] . ' ' . $_xh['isf_reason'], '', $httpResponse); |
|
332 | + PhpXmlRpc::$xmlrpcstr['invalid_xml'].' '.$_xh['isf_reason'], '', $httpResponse); |
|
333 | 333 | |
334 | - if ($this->debug > 0) { |
|
334 | + if ($this->debug>0) { |
|
335 | 335 | $this->getLogger()->debug($_xh['isf_reason']); |
336 | 336 | } |
337 | 337 | } |
338 | 338 | // second error check: xml well-formed but not xml-rpc compliant |
339 | 339 | elseif ($_xh['isf'] == 2) { |
340 | 340 | $r = new Response(0, PhpXmlRpc::$xmlrpcerr['xml_not_compliant'], |
341 | - PhpXmlRpc::$xmlrpcstr['xml_not_compliant'] . ' ' . $_xh['isf_reason'], '', $httpResponse); |
|
341 | + PhpXmlRpc::$xmlrpcstr['xml_not_compliant'].' '.$_xh['isf_reason'], '', $httpResponse); |
|
342 | 342 | |
343 | 343 | /// @todo echo something for the user? check if it was already done by the parser... |
344 | 344 | //if ($this->debug > 0) { |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | } |
348 | 348 | // third error check: parsing of the response has somehow gone boink. |
349 | 349 | /// @todo shall we omit this check, since we trust the parsing code? |
350 | - elseif ($_xh['isf'] > 3 || $returnType == XMLParser::RETURN_XMLRPCVALS && !is_object($_xh['value'])) { |
|
350 | + elseif ($_xh['isf']>3 || $returnType == XMLParser::RETURN_XMLRPCVALS && !is_object($_xh['value'])) { |
|
351 | 351 | // something odd has happened and it's time to generate a client side error indicating something odd went on |
352 | 352 | $r = new Response(0, PhpXmlRpc::$xmlrpcerr['xml_parsing_error'], PhpXmlRpc::$xmlrpcstr['xml_parsing_error'], |
353 | 353 | '', $httpResponse |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | |
356 | 356 | /// @todo echo something for the user? |
357 | 357 | } else { |
358 | - if ($this->debug > 1) { |
|
358 | + if ($this->debug>1) { |
|
359 | 359 | $this->getLogger()->debug( |
360 | 360 | "---PARSED---\n".var_export($_xh['value'], true)."\n---END---" |
361 | 361 | ); |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | if ($errNo == 0) { |
380 | 380 | // FAULT returned, errno needs to reflect that |
381 | 381 | /// @todo feature creep - add this code to PhpXmlRpc::$xmlrpcerr |
382 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': fault response received with faultCode 0 or null. Converted it to -1'); |
|
382 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': fault response received with faultCode 0 or null. Converted it to -1'); |
|
383 | 383 | $errNo = -1; |
384 | 384 | } |
385 | 385 |
@@ -78,13 +78,13 @@ discard block |
||
78 | 78 | <body> |
79 | 79 | <?php |
80 | 80 | |
81 | -include __DIR__ . '/common.php'; |
|
81 | +include __DIR__.'/common.php'; |
|
82 | 82 | |
83 | 83 | if ($action) { |
84 | 84 | |
85 | 85 | // avoid php hanging when using the builtin webserver and sending requests to itself |
86 | 86 | $skip = false; |
87 | - if (php_sapi_name() === 'cli-server' && ((int)getenv('PHP_CLI_SERVER_WORKERS') < 2)) { |
|
87 | + if (php_sapi_name() === 'cli-server' && ((int) getenv('PHP_CLI_SERVER_WORKERS')<2)) { |
|
88 | 88 | $localHost = explode(':', $_SERVER['HTTP_HOST']); |
89 | 89 | /// @todo support also case where port is null (on either side), and when there is a Proxy in the parameters, |
90 | 90 | /// and that proxy is us |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if (!$skip) { |
98 | 98 | // make sure the script waits long enough for the call to complete... |
99 | 99 | if ($timeout) { |
100 | - set_time_limit($timeout + 10); |
|
100 | + set_time_limit($timeout+10); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | if ($wstype == 1) { |
@@ -118,13 +118,13 @@ discard block |
||
118 | 118 | $server = "$host$path"; |
119 | 119 | } |
120 | 120 | if ($protocol == 2 || $protocol == 3) { |
121 | - $server = 'https://' . $server; |
|
121 | + $server = 'https://'.$server; |
|
122 | 122 | } else { |
123 | - $server = 'http://' . $server; |
|
123 | + $server = 'http://'.$server; |
|
124 | 124 | } |
125 | 125 | if ($proxy != '') { |
126 | 126 | $pproxy = explode(':', $proxy); |
127 | - if (count($pproxy) > 1) { |
|
127 | + if (count($pproxy)>1) { |
|
128 | 128 | $pport = $pproxy[1]; |
129 | 129 | } else { |
130 | 130 | $pport = 8080; |
@@ -199,9 +199,9 @@ discard block |
||
199 | 199 | case 'wrap': |
200 | 200 | $msg[0] = new $requestClass('system.methodHelp', array(), $id); |
201 | 201 | $msg[0]->addparam(new PhpXmlRpc\Value($method)); |
202 | - $msg[1] = new $requestClass('system.methodSignature', array(), (int)$id + 1); |
|
202 | + $msg[1] = new $requestClass('system.methodSignature', array(), (int) $id+1); |
|
203 | 203 | $msg[1]->addparam(new PhpXmlRpc\Value($method)); |
204 | - $actionname = 'Description of method "' . $method . '"'; |
|
204 | + $actionname = 'Description of method "'.$method.'"'; |
|
205 | 205 | break; |
206 | 206 | case 'list': |
207 | 207 | $msg[0] = new $requestClass('system.listMethods', array(), $id); |
@@ -214,9 +214,9 @@ discard block |
||
214 | 214 | $msg[0] = new $requestClass($method, array(), $id); |
215 | 215 | // hack! build payload by hand |
216 | 216 | if ($wstype == 1) { |
217 | - $payload = "{\n" . |
|
218 | - '"method": "' . $method . "\",\n\"params\": [" . |
|
219 | - $payload . |
|
217 | + $payload = "{\n". |
|
218 | + '"method": "'.$method."\",\n\"params\": [". |
|
219 | + $payload. |
|
220 | 220 | "\n],\n\"id\": "; |
221 | 221 | // fix: if user gave an empty string, use NULL, or we'll break json syntax |
222 | 222 | if ($id == "") { |
@@ -231,22 +231,22 @@ discard block |
||
231 | 231 | $msg[0]->setPayload($payload); |
232 | 232 | } else { |
233 | 233 | $msg[0]->setPayload( |
234 | - $msg[0]->xml_header($inputcharset) . |
|
235 | - '<methodName>' . $method . "</methodName>\n<params>" . |
|
236 | - $payload . |
|
237 | - "</params>\n" . $msg[0]->xml_footer() |
|
234 | + $msg[0]->xml_header($inputcharset). |
|
235 | + '<methodName>'.$method."</methodName>\n<params>". |
|
236 | + $payload. |
|
237 | + "</params>\n".$msg[0]->xml_footer() |
|
238 | 238 | ); |
239 | 239 | } |
240 | - $actionname = 'Execution of method ' . $method; |
|
240 | + $actionname = 'Execution of method '.$method; |
|
241 | 241 | break; |
242 | 242 | default: // give a warning |
243 | - $actionname = '[ERROR: unknown action] "' . $action . '"'; |
|
243 | + $actionname = '[ERROR: unknown action] "'.$action.'"'; |
|
244 | 244 | } |
245 | 245 | } |
246 | 246 | |
247 | 247 | // Before calling execute, echo out brief description of action taken + date and time ??? |
248 | 248 | // this gives good user feedback for long-running methods... |
249 | - echo '<h2>' . htmlspecialchars($actionname, ENT_COMPAT, $inputcharset) . ' on server ' . htmlspecialchars($server, ENT_COMPAT, $inputcharset) . " ...</h2>\n"; |
|
249 | + echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset)." ...</h2>\n"; |
|
250 | 250 | flush(); |
251 | 251 | |
252 | 252 | $response = null; |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | break; |
264 | 264 | } |
265 | 265 | } |
266 | - $time = microtime(true) - $time; |
|
266 | + $time = microtime(true)-$time; |
|
267 | 267 | if ($debug) { |
268 | 268 | echo "</div>\n"; |
269 | 269 | } |
@@ -273,8 +273,8 @@ discard block |
||
273 | 273 | // call failed! echo out error msg! |
274 | 274 | //echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset).'</h2>'; |
275 | 275 | echo "<h3>$protoName call FAILED!</h3>\n"; |
276 | - echo "<p>Fault code: [" . htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
277 | - "] Reason: '" . htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "'</p>\n"; |
|
276 | + echo "<p>Fault code: [".htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
277 | + "] Reason: '".htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."'</p>\n"; |
|
278 | 278 | echo(date("d/M/Y:H:i:s\n")); |
279 | 279 | } else { |
280 | 280 | // call succeeded: parse results |
@@ -290,36 +290,36 @@ discard block |
||
290 | 290 | $max = $v->count(); |
291 | 291 | echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; |
292 | 292 | echo "<thead>\n<tr><th>Method ($max)</th><th>Description</th></tr>\n</thead>\n<tbody>\n"; |
293 | - foreach($v as $i => $rec) { |
|
293 | + foreach ($v as $i => $rec) { |
|
294 | 294 | if ($i % 2) { |
295 | 295 | $class = ' class="oddrow"'; |
296 | 296 | } else { |
297 | 297 | $class = ' class="evenrow"'; |
298 | 298 | } |
299 | - echo("<tr><td$class>" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">" . |
|
300 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
301 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
302 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
303 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
304 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
305 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
306 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
307 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
308 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
309 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
310 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
311 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
312 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
313 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
314 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
315 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
316 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
317 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
318 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
319 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "\" />" . |
|
320 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
321 | - "<input type=\"hidden\" name=\"action\" value=\"describe\" />" . |
|
322 | - "<input type=\"hidden\" name=\"run\" value=\"now\" />" . |
|
299 | + echo("<tr><td$class>".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">". |
|
300 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
301 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
302 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
303 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
304 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
305 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
306 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
307 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
308 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
309 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
310 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
311 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
312 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
313 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
314 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
315 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
316 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
317 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
318 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
319 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."\" />". |
|
320 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
321 | + "<input type=\"hidden\" name=\"action\" value=\"describe\" />". |
|
322 | + "<input type=\"hidden\" name=\"run\" value=\"now\" />". |
|
323 | 323 | "<input type=\"submit\" value=\"Describe\" /></form></td>"); |
324 | 324 | //echo("</tr>\n"); |
325 | 325 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | $r2 = $resp[1]->value(); |
347 | 347 | |
348 | 348 | echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; |
349 | - echo "<thead>\n<tr><th>Method</th><th>" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "</th><th> </th><th> </th></tr>\n</thead>\n<tbody>\n"; |
|
349 | + echo "<thead>\n<tr><th>Method</th><th>".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."</th><th> </th><th> </th></tr>\n</thead>\n<tbody>\n"; |
|
350 | 350 | $desc = htmlspecialchars($r1->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
351 | 351 | if ($desc == "") { |
352 | 352 | $desc = "-"; |
@@ -356,24 +356,24 @@ discard block |
||
356 | 356 | if ($r2->kindOf() != "array") { |
357 | 357 | echo "<tr><td class=\"oddrow\">Signature</td><td class=\"oddrow\">Unknown</td><td class=\"oddrow\"> </td></tr>\n"; |
358 | 358 | } else { |
359 | - foreach($r2 as $i => $x) { |
|
359 | + foreach ($r2 as $i => $x) { |
|
360 | 360 | $payload = ""; |
361 | 361 | $alt_payload = ""; |
362 | - if ($i + 1 % 2) { |
|
362 | + if ($i+1 % 2) { |
|
363 | 363 | $class = ' class="oddrow"'; |
364 | 364 | } else { |
365 | 365 | $class = ' class="evenrow"'; |
366 | 366 | } |
367 | - echo "<tr><td$class>Signature " . ($i + 1) . "</td><td$class>"; |
|
367 | + echo "<tr><td$class>Signature ".($i+1)."</td><td$class>"; |
|
368 | 368 | if ($x->kindOf() == "array") { |
369 | 369 | $ret = $x[0]; |
370 | - echo "<code>OUT: " . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: ("; |
|
371 | - if ($x->count() > 1) { |
|
372 | - foreach($x as $k => $y) { |
|
370 | + echo "<code>OUT: ".htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."<br />IN: ("; |
|
371 | + if ($x->count()>1) { |
|
372 | + foreach ($x as $k => $y) { |
|
373 | 373 | if ($k == 0) continue; |
374 | 374 | echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
375 | 375 | if ($wstype == 1) { |
376 | - switch($y->scalarval()) { |
|
376 | + switch ($y->scalarval()) { |
|
377 | 377 | case 'string': |
378 | 378 | case 'dateTime.iso8601': |
379 | 379 | case 'base64': |
@@ -406,22 +406,22 @@ discard block |
||
406 | 406 | } else { |
407 | 407 | $type = $y->scalarval(); |
408 | 408 | $payload .= '<param><value>'; |
409 | - switch($type) { |
|
409 | + switch ($type) { |
|
410 | 410 | case 'undefined': |
411 | 411 | break; |
412 | 412 | case 'null'; |
413 | 413 | $type = 'nil'; |
414 | 414 | // fall thru intentionally |
415 | 415 | default: |
416 | - $payload .= '<' . |
|
417 | - htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
418 | - '></' . htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
416 | + $payload .= '<'. |
|
417 | + htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
418 | + '></'.htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
419 | 419 | '>'; |
420 | 420 | } |
421 | 421 | $payload .= "</value></param>\n"; |
422 | 422 | } |
423 | 423 | $alt_payload .= $y->scalarval(); |
424 | - if ($k < $x->count() - 1) { |
|
424 | + if ($k<$x->count()-1) { |
|
425 | 425 | $alt_payload .= ';'; |
426 | 426 | if ($wstype == 1) { |
427 | 427 | $payload .= ', '; |
@@ -437,63 +437,63 @@ discard block |
||
437 | 437 | echo '</td>'; |
438 | 438 | // button to test this method |
439 | 439 | //$payload="<methodCall>\n<methodName>$method</methodName>\n<params>\n$payload</params>\n</methodCall>"; |
440 | - echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" . |
|
441 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
442 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
443 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
444 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
445 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
446 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
447 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
448 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
449 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
450 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
451 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
452 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
453 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
454 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
455 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
456 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
457 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
458 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
459 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
460 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" . |
|
461 | - "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
462 | - "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
463 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
440 | + echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">". |
|
441 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
442 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
443 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
444 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
445 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
446 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
447 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
448 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
449 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
450 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
451 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
452 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
453 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
454 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
455 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
456 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
457 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
458 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
459 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
460 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />". |
|
461 | + "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />". |
|
462 | + "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />". |
|
463 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
464 | 464 | "<input type=\"hidden\" name=\"action\" value=\"execute\" />"; |
465 | 465 | //if ($wstype != 1) { |
466 | 466 | echo "<input type=\"submit\" value=\"Load method synopsis\" />"; |
467 | 467 | //} |
468 | 468 | echo "</form></td>\n"; |
469 | 469 | |
470 | - echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" . |
|
471 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
472 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
473 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
474 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
475 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
476 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
477 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
478 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
479 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
480 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
481 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
482 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
483 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
484 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
485 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
486 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
487 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
488 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
489 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
490 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" . |
|
491 | - "<input type=\"hidden\" name=\"methodsig\" value=\"" . $i . "\" />" . |
|
492 | - "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
493 | - "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
494 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
495 | - "<input type=\"hidden\" name=\"action\" value=\"wrap\" />" . |
|
496 | - "<input type=\"hidden\" name=\"run\" value=\"now\" />" . |
|
470 | + echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">". |
|
471 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
472 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
473 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
474 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
475 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
476 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
477 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
478 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
479 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
480 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
481 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
482 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
483 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
484 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
485 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
486 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
487 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
488 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
489 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
490 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />". |
|
491 | + "<input type=\"hidden\" name=\"methodsig\" value=\"".$i."\" />". |
|
492 | + "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />". |
|
493 | + "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />". |
|
494 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
495 | + "<input type=\"hidden\" name=\"action\" value=\"wrap\" />". |
|
496 | + "<input type=\"hidden\" name=\"run\" value=\"now\" />". |
|
497 | 497 | "<input type=\"submit\" value=\"Generate method call stub code\" />"; |
498 | 498 | echo "</form></td></tr>\n"; |
499 | 499 | } |
@@ -505,14 +505,14 @@ discard block |
||
505 | 505 | case 'wrap': |
506 | 506 | $r1 = $resp[0]->value(); |
507 | 507 | $r2 = $resp[1]->value(); |
508 | - if ($r2->kindOf() != "array" || $r2->count() <= $methodsig) { |
|
508 | + if ($r2->kindOf() != "array" || $r2->count()<=$methodsig) { |
|
509 | 509 | echo "Error: signature unknown\n"; |
510 | 510 | } else { |
511 | 511 | $mdesc = $r1->scalarval(); |
512 | 512 | $encoder = new PhpXmlRpc\Encoder(); |
513 | 513 | $msig = $encoder->decode($r2); |
514 | 514 | $msig = $msig[$methodsig]; |
515 | - $proto = ($protocol == 1) ? 'http11' : ( $protocol == 2 ? 'https' : ( $protocol == 3 ? 'h2' : ( $protocol == 4 ? 'h2c' : '' ) ) ); |
|
515 | + $proto = ($protocol == 1) ? 'http11' : ($protocol == 2 ? 'https' : ($protocol == 3 ? 'h2' : ($protocol == 4 ? 'h2c' : ''))); |
|
516 | 516 | if ($proxy == '' && $username == '' && !$requestcompression && !$responsecompression && |
517 | 517 | $clientcookies == '') { |
518 | 518 | $opts = 1; // simple client copy in stub code |
@@ -533,12 +533,12 @@ discard block |
||
533 | 533 | $client, |
534 | 534 | $method, |
535 | 535 | array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix, 'throw_on_fault' => true), |
536 | - str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc |
|
536 | + str_replace('.', '_', $prefix.'_'.$method), $msig, $mdesc |
|
537 | 537 | ); |
538 | 538 | //if ($code) |
539 | 539 | //{ |
540 | 540 | echo "<div id=\"phpcode\">\n"; |
541 | - highlight_string("<?php\n" . $code['docstring'] . $code['source']); |
|
541 | + highlight_string("<?php\n".$code['docstring'].$code['source']); |
|
542 | 542 | echo "\n</div>"; |
543 | 543 | //} |
544 | 544 | //else |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | break; |
550 | 550 | |
551 | 551 | case 'execute': |
552 | - echo '<div id="response"><h2>Response:</h2>' . htmlspecialchars($response->serialize()) . '</div>'; |
|
552 | + echo '<div id="response"><h2>Response:</h2>'.htmlspecialchars($response->serialize()).'</div>'; |
|
553 | 553 | break; |
554 | 554 | |
555 | 555 | default: // give a warning |