@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $this->me['struct'] = $val; |
120 | 120 | break; |
121 | 121 | default: |
122 | - $this->getLogger()->errorLog("XML-RPC: " . __METHOD__ . ": not a known type ($type)"); |
|
122 | + $this->getLogger()->errorLog("XML-RPC: ".__METHOD__.": not a known type ($type)"); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | if ($typeOf !== 1) { |
147 | - $this->getLogger()->errorLog("XML-RPC: " . __METHOD__ . ": not a scalar type ($type)"); |
|
147 | + $this->getLogger()->errorLog("XML-RPC: ".__METHOD__.": not a scalar type ($type)"); |
|
148 | 148 | return 0; |
149 | 149 | } |
150 | 150 | |
@@ -161,10 +161,10 @@ discard block |
||
161 | 161 | |
162 | 162 | switch ($this->mytype) { |
163 | 163 | case 1: |
164 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': scalar xmlrpc value can have only one value'); |
|
164 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': scalar xmlrpc value can have only one value'); |
|
165 | 165 | return 0; |
166 | 166 | case 3: |
167 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': cannot add anonymous scalar to struct xmlrpc value'); |
|
167 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': cannot add anonymous scalar to struct xmlrpc value'); |
|
168 | 168 | return 0; |
169 | 169 | case 2: |
170 | 170 | // we're adding a scalar value to an array here |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | return 1; |
208 | 208 | } else { |
209 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']'); |
|
209 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']'); |
|
210 | 210 | return 0; |
211 | 211 | } |
212 | 212 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | |
238 | 238 | return 1; |
239 | 239 | } else { |
240 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']'); |
|
240 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']'); |
|
241 | 241 | return 0; |
242 | 242 | } |
243 | 243 | } |
@@ -280,19 +280,19 @@ discard block |
||
280 | 280 | case 1: |
281 | 281 | switch ($typ) { |
282 | 282 | case static::$xmlrpcBase64: |
283 | - $rs .= "<{$typ}>" . base64_encode($val) . "</{$typ}>"; |
|
283 | + $rs .= "<{$typ}>".base64_encode($val)."</{$typ}>"; |
|
284 | 284 | break; |
285 | 285 | case static::$xmlrpcBoolean: |
286 | - $rs .= "<{$typ}>" . ($val ? '1' : '0') . "</{$typ}>"; |
|
286 | + $rs .= "<{$typ}>".($val ? '1' : '0')."</{$typ}>"; |
|
287 | 287 | break; |
288 | 288 | case static::$xmlrpcString: |
289 | 289 | // Do NOT use htmlentities, since it will produce named html entities, which are invalid xml |
290 | - $rs .= "<{$typ}>" . $this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</{$typ}>"; |
|
290 | + $rs .= "<{$typ}>".$this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</{$typ}>"; |
|
291 | 291 | break; |
292 | 292 | case static::$xmlrpcInt: |
293 | 293 | case static::$xmlrpcI4: |
294 | 294 | case static::$xmlrpcI8: |
295 | - $rs .= "<{$typ}>" . (int)$val . "</{$typ}>"; |
|
295 | + $rs .= "<{$typ}>".(int) $val."</{$typ}>"; |
|
296 | 296 | break; |
297 | 297 | case static::$xmlrpcDouble: |
298 | 298 | // avoid using standard conversion of float to string because it is locale-dependent, |
@@ -300,16 +300,16 @@ discard block |
||
300 | 300 | // sprintf('%F') could be most likely ok, but it fails eg. on 2e-14. |
301 | 301 | // The code below tries its best at keeping max precision while avoiding exp notation, |
302 | 302 | // but there is of course no limit in the number of decimal places to be used... |
303 | - $rs .= "<{$typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, PhpXmlRpc::$xmlpc_double_precision, '.', '')) . "</{$typ}>"; |
|
303 | + $rs .= "<{$typ}>".preg_replace('/\\.?0+$/', '', number_format((double) $val, PhpXmlRpc::$xmlpc_double_precision, '.', ''))."</{$typ}>"; |
|
304 | 304 | break; |
305 | 305 | case static::$xmlrpcDateTime: |
306 | 306 | if (is_string($val)) { |
307 | 307 | $rs .= "<{$typ}>{$val}</{$typ}>"; |
308 | 308 | // DateTimeInterface is not present in php 5.4... |
309 | 309 | } elseif (is_a($val, 'DateTimeInterface') || is_a($val, 'DateTime')) { |
310 | - $rs .= "<{$typ}>" . $val->format('Ymd\TH:i:s') . "</{$typ}>"; |
|
310 | + $rs .= "<{$typ}>".$val->format('Ymd\TH:i:s')."</{$typ}>"; |
|
311 | 311 | } elseif (is_int($val)) { |
312 | - $rs .= "<{$typ}>" . date('Ymd\TH:i:s', $val) . "</{$typ}>"; |
|
312 | + $rs .= "<{$typ}>".date('Ymd\TH:i:s', $val)."</{$typ}>"; |
|
313 | 313 | } else { |
314 | 314 | // not really a good idea here: but what should we output anyway? left for backward compat... |
315 | 315 | $rs .= "<{$typ}>{$val}</{$typ}>"; |
@@ -331,14 +331,14 @@ discard block |
||
331 | 331 | case 3: |
332 | 332 | // struct |
333 | 333 | if ($this->_php_class) { |
334 | - $rs .= '<struct php_class="' . $this->_php_class . "\">\n"; |
|
334 | + $rs .= '<struct php_class="'.$this->_php_class."\">\n"; |
|
335 | 335 | } else { |
336 | 336 | $rs .= "<struct>\n"; |
337 | 337 | } |
338 | 338 | $charsetEncoder = $this->getCharsetEncoder(); |
339 | 339 | /** @var Value $val2 */ |
340 | 340 | foreach ($val as $key2 => $val2) { |
341 | - $rs .= '<member><name>' . $charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</name>\n"; |
|
341 | + $rs .= '<member><name>'.$charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</name>\n"; |
|
342 | 342 | //$rs.=$this->serializeval($val2); |
343 | 343 | $rs .= $val2->serialize($charsetEncoding); |
344 | 344 | $rs .= "</member>\n"; |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $val = reset($this->me); |
375 | 375 | $typ = key($this->me); |
376 | 376 | |
377 | - return '<value>' . $this->serializedata($typ, $val, $charsetEncoding) . "</value>\n"; |
|
377 | + return '<value>'.$this->serializedata($typ, $val, $charsetEncoding)."</value>\n"; |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | /** |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * @license code licensed under the BSD License: see file license.txt |
11 | 11 | */ |
12 | 12 | |
13 | -require_once __DIR__ . "/_prepend.php"; |
|
13 | +require_once __DIR__."/_prepend.php"; |
|
14 | 14 | |
15 | 15 | // *** NB: WE BLOCK THIS FROM RUNNING BY DEFAULT IN CASE ACCESS IS GRANTED TO IT IN PRODUCTION BY MISTAKE *** |
16 | 16 | // Comment out the following safeguard if you want to use it as is, but remember: this is an open relay !!! |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | // NB: here we should validate the received url, using f.e. a whitelist... |
36 | 36 | $client = new PhpXmlRpc\Client($url); |
37 | 37 | |
38 | - if ($req->getNumParams() > 3) { |
|
38 | + if ($req->getNumParams()>3) { |
|
39 | 39 | // we have to set some options onto the client. |
40 | 40 | // Note that if we do not untaint the received values, warnings might be generated... |
41 | 41 | $options = $encoder->decode($req->getParam(3)); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $client->setSSLVerifyPeer($val); |
58 | 58 | break; |
59 | 59 | case 'Timeout': |
60 | - $timeout = (integer)$val; |
|
60 | + $timeout = (integer) $val; |
|
61 | 61 | break; |
62 | 62 | } // switch |
63 | 63 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | // add debug info into response we give back to caller |
78 | - PhpXmlRpc\Server::xmlrpc_debugmsg("Sending to server $url the payload: " . $req->serialize()); |
|
78 | + PhpXmlRpc\Server::xmlrpc_debugmsg("Sending to server $url the payload: ".$req->serialize()); |
|
79 | 79 | |
80 | 80 | return $client->send($req, $timeout); |
81 | 81 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require_once __DIR__ . "/client/_prepend.php"; |
|
2 | +require_once __DIR__."/client/_prepend.php"; |
|
3 | 3 | |
4 | 4 | output('<html lang="en"> |
5 | 5 | <head><title>xmlrpc</title></head> |
@@ -10,23 +10,23 @@ discard block |
||
10 | 10 | output("<p>Please note that in most cases you are better off using `new PhpXmlRpc\Encoder()->encode()` to create nested Value objects</p>\n"); |
11 | 11 | |
12 | 12 | $v = new PhpXmlRpc\Value(1234, 'int'); |
13 | -output("Int: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
13 | +output("Int: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
14 | 14 | |
15 | 15 | $v = new PhpXmlRpc\Value('Are the following characters escaped? < & >'); |
16 | -output("String <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
16 | +output("String <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
17 | 17 | |
18 | 18 | $v = new PhpXmlRpc\Value(true, 'boolean'); |
19 | -output("Boolean: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
19 | +output("Boolean: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
20 | 20 | |
21 | 21 | $v = new PhpXmlRpc\Value(1234.5678, 'double'); |
22 | -output("Double: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
22 | +output("Double: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
23 | 23 | |
24 | 24 | $v = new PhpXmlRpc\Value(time(), 'dateTime.iso8601'); |
25 | -output("Datetime: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
25 | +output("Datetime: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
26 | 26 | |
27 | 27 | $v = new PhpXmlRpc\Value('hello world', 'base64'); |
28 | -output("Base64: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
29 | -output("(value of base64 string is: '" . $v->scalarval() . "')<BR><BR>"); |
|
28 | +output("Base64: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
29 | +output("(value of base64 string is: '".$v->scalarval()."')<BR><BR>"); |
|
30 | 30 | |
31 | 31 | $v = new PhpXmlRpc\Value( |
32 | 32 | array( |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | ), |
40 | 40 | "array" |
41 | 41 | ); |
42 | -output("Array: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
42 | +output("Array: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
43 | 43 | |
44 | 44 | $v = new PhpXmlRpc\Value( |
45 | 45 | array( |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | ), |
60 | 60 | "struct" |
61 | 61 | ); |
62 | -output("Struct: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
62 | +output("Struct: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
63 | 63 | |
64 | 64 | $w = new PhpXmlRpc\Value(array($v), 'array'); |
65 | -output("Array containing a struct: <PRE>" . htmlentities($w->serialize()) . "</PRE>"); |
|
65 | +output("Array containing a struct: <PRE>".htmlentities($w->serialize())."</PRE>"); |
|
66 | 66 | |
67 | 67 | /*$w = new PhpXmlRpc\Value("Mary had a little lamb, |
68 | 68 | Whose fleece was white as snow, |
@@ -81,21 +81,21 @@ discard block |
||
81 | 81 | $req = new PhpXmlRpc\Request('examples.getStateName'); |
82 | 82 | $req->method('examples.getStateName'); |
83 | 83 | $req->addParam(new PhpXmlRpc\Value(42, 'int')); |
84 | -output("<PRE>" . htmlentities($req->serialize()) . "</PRE>"); |
|
84 | +output("<PRE>".htmlentities($req->serialize())."</PRE>"); |
|
85 | 85 | |
86 | 86 | output("<h3>Testing response serialization</h3>\n"); |
87 | 87 | $resp = new PhpXmlRpc\Response(new PhpXmlRpc\Value('The meaning of life')); |
88 | -output("<PRE>" . htmlentities($resp->serialize()) . "</PRE>"); |
|
88 | +output("<PRE>".htmlentities($resp->serialize())."</PRE>"); |
|
89 | 89 | |
90 | 90 | output("<h3>Testing ISO date formatting</h3><pre>\n"); |
91 | 91 | $t = time(); |
92 | 92 | $date = PhpXmlRpc\Helper\Date::iso8601Encode($t); |
93 | 93 | output("Now is $t --> $date\n"); |
94 | -output("Or in UTC, that is " . PhpXmlRpc\Helper\Date::iso8601Encode($t, 1) . "\n"); |
|
94 | +output("Or in UTC, that is ".PhpXmlRpc\Helper\Date::iso8601Encode($t, 1)."\n"); |
|
95 | 95 | $tb = PhpXmlRpc\Helper\Date::iso8601Decode($date); |
96 | 96 | output("That is to say $date --> $tb\n"); |
97 | -output("Which comes out at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb) . "\n"); |
|
98 | -output("Which was the time in UTC at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb, 1) . "\n"); |
|
97 | +output("Which comes out at ".PhpXmlRpc\Helper\Date::iso8601Encode($tb)."\n"); |
|
98 | +output("Which was the time in UTC at ".PhpXmlRpc\Helper\Date::iso8601Encode($tb, 1)."\n"); |
|
99 | 99 | output("</pre>\n"); |
100 | 100 | |
101 | 101 | output('</body></html>'); |