@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | ); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - public static function getOpts($args=array(), $cliOpts=array()) |
|
| 60 | + public static function getOpts($args = array(), $cliOpts = array()) |
|
| 61 | 61 | { |
| 62 | - if (count($args) > 0) |
|
| 62 | + if (count($args)>0) |
|
| 63 | 63 | // throw new \Exception('Missing library version argument'); |
| 64 | 64 | self::$libVersion = $args[0]; |
| 65 | 65 | |
@@ -157,17 +157,17 @@ discard block |
||
| 157 | 157 | $out = ''; |
| 158 | 158 | while (($start = strpos($content, $startTag, $last)) !== false) { |
| 159 | 159 | $end = strpos($content, $endTag, $start); |
| 160 | - $code = substr($content, $start + strlen($startTag), $end - $start - strlen($startTag)); |
|
| 161 | - if ($code[strlen($code) - 1] == "\n") { |
|
| 160 | + $code = substr($content, $start+strlen($startTag), $end-$start-strlen($startTag)); |
|
| 161 | + if ($code[strlen($code)-1] == "\n") { |
|
| 162 | 162 | $code = substr($code, 0, -1); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | $code = str_replace(array('>', '<'), array('>', '<'), $code); |
| 166 | - $code = highlight_string('<?php ' . $code, true); |
|
| 166 | + $code = highlight_string('<?php '.$code, true); |
|
| 167 | 167 | $code = str_replace('<span style="color: #0000BB"><?php <br />', '<span style="color: #0000BB">', $code); |
| 168 | 168 | |
| 169 | - $out = $out . substr($content, $last, $start + strlen($startTag) - $last) . $code . $endTag; |
|
| 170 | - $last = $end + strlen($endTag); |
|
| 169 | + $out = $out.substr($content, $last, $start+strlen($startTag)-$last).$code.$endTag; |
|
| 170 | + $last = $end+strlen($endTag); |
|
| 171 | 171 | } |
| 172 | 172 | $out .= substr($content, $last, strlen($content)); |
| 173 | 173 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | use PhpXmlRpc\Builder; |
| 183 | 183 | |
| 184 | -function run_default($task=null, $args=array(), $cliOpts=array()) |
|
| 184 | +function run_default($task = null, $args = array(), $cliOpts = array()) |
|
| 185 | 185 | { |
| 186 | 186 | echo "Syntax: pake {\$pake-options} \$task \$lib-version [\$git-tag] {\$task-options}\n"; |
| 187 | 187 | echo "\n"; |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | echo " --zip=ZIP Location of the zip tool\n"; |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | -function run_getopts($task=null, $args=array(), $cliOpts=array()) |
|
| 201 | +function run_getopts($task = null, $args = array(), $cliOpts = array()) |
|
| 202 | 202 | { |
| 203 | 203 | Builder::getOpts($args, $cliOpts); |
| 204 | 204 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | /** |
| 207 | 207 | * Downloads source code in the build workspace directory, optionally checking out the given branch/tag |
| 208 | 208 | */ |
| 209 | -function run_init($task=null, $args=array(), $cliOpts=array()) |
|
| 209 | +function run_init($task = null, $args = array(), $cliOpts = array()) |
|
| 210 | 210 | { |
| 211 | 211 | // download the current version into the workspace |
| 212 | 212 | $targetDir = Builder::workspaceDir(); |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | * |
| 235 | 235 | * (does nothing by itself, as all the steps are managed via task dependencies) |
| 236 | 236 | */ |
| 237 | -function run_build($task=null, $args=array(), $cliOpts=array()) |
|
| 237 | +function run_build($task = null, $args = array(), $cliOpts = array()) |
|
| 238 | 238 | { |
| 239 | 239 | } |
| 240 | 240 | |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | /** |
| 251 | 251 | * Generates documentation in all formats |
| 252 | 252 | */ |
| 253 | -function run_doc($task=null, $args=array(), $cliOpts=array()) |
|
| 253 | +function run_doc($task = null, $args = array(), $cliOpts = array()) |
|
| 254 | 254 | { |
| 255 | 255 | $docDir = Builder::workspaceDir().'/doc'; |
| 256 | 256 | |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | /** |
| 319 | 319 | * Creates the tarballs for a release |
| 320 | 320 | */ |
| 321 | -function run_dist($task=null, $args=array(), $cliOpts=array()) |
|
| 321 | +function run_dist($task = null, $args = array(), $cliOpts = array()) |
|
| 322 | 322 | { |
| 323 | 323 | // copy workspace dir into dist dir, without git |
| 324 | 324 | pake_mkdirs(Builder::distDir()); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | // create tarballs |
| 333 | 333 | $cwd = getcwd(); |
| 334 | 334 | chdir(dirname(Builder::distDir())); |
| 335 | - foreach(Builder::distFiles() as $distFile) { |
|
| 335 | + foreach (Builder::distFiles() as $distFile) { |
|
| 336 | 336 | // php can not really create good zip files via phar: they are not compressed! |
| 337 | 337 | if (substr($distFile, -4) == '.zip') { |
| 338 | 338 | $cmd = Builder::tool('zip'); |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | chdir($cwd); |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | -function run_clean_workspace($task=null, $args=array(), $cliOpts=array()) |
|
| 353 | +function run_clean_workspace($task = null, $args = array(), $cliOpts = array()) |
|
| 354 | 354 | { |
| 355 | 355 | pake_remove_dir(Builder::workspaceDir()); |
| 356 | 356 | } |
@@ -359,13 +359,13 @@ discard block |
||
| 359 | 359 | * Cleans up the whole build directory |
| 360 | 360 | * @todo 'make clean' usually just removes the results of the build, distclean removes all but sources |
| 361 | 361 | */ |
| 362 | -function run_clean($task=null, $args=array(), $cliOpts=array()) |
|
| 362 | +function run_clean($task = null, $args = array(), $cliOpts = array()) |
|
| 363 | 363 | { |
| 364 | 364 | pake_remove_dir(Builder::buildDir()); |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | // helper task: display help text |
| 368 | -pake_task( 'default' ); |
|
| 368 | +pake_task('default'); |
|
| 369 | 369 | // internal task: parse cli options |
| 370 | 370 | pake_task('getopts'); |
| 371 | 371 | pake_task('init', 'getopts'); |
@@ -27,8 +27,9 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public static function libVersion() |
| 29 | 29 | { |
| 30 | - if (self::$libVersion == null) |
|
| 31 | - throw new \Exception('Missing library version argument'); |
|
| 30 | + if (self::$libVersion == null) { |
|
| 31 | + throw new \Exception('Missing library version argument'); |
|
| 32 | + } |
|
| 32 | 33 | return self::$libVersion; |
| 33 | 34 | } |
| 34 | 35 | |
@@ -59,9 +60,10 @@ discard block |
||
| 59 | 60 | |
| 60 | 61 | public static function getOpts($args=array(), $cliOpts=array()) |
| 61 | 62 | { |
| 62 | - if (count($args) > 0) |
|
| 63 | - // throw new \Exception('Missing library version argument'); |
|
| 63 | + if (count($args) > 0) { |
|
| 64 | + // throw new \Exception('Missing library version argument'); |
|
| 64 | 65 | self::$libVersion = $args[0]; |
| 66 | + } |
|
| 65 | 67 | |
| 66 | 68 | foreach (self::$tools as $name => $binary) { |
| 67 | 69 | if (isset($cliOpts[$name])) { |
@@ -338,8 +340,7 @@ discard block |
||
| 338 | 340 | $cmd = Builder::tool('zip'); |
| 339 | 341 | $extra = '-9 -r'; |
| 340 | 342 | pake_sh("$cmd $distFile $extra ".basename(Builder::distDir())); |
| 341 | - } |
|
| 342 | - else { |
|
| 343 | + } else { |
|
| 343 | 344 | $finder = pakeFinder::type('any')->pattern(basename(Builder::distDir()).'/**'); |
| 344 | 345 | // see https://bugs.php.net/bug.php?id=58852 |
| 345 | 346 | $pharFile = str_replace(Builder::libVersion(), '_LIBVERSION_', $distFile); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | // make sure we set the correct charset type for output, so that we can display all characters |
| 16 | 16 | header('Content-Type: text/html; charset=utf-8'); |
| 17 | 17 | |
| 18 | -include __DIR__ . '/common.php'; |
|
| 18 | +include __DIR__.'/common.php'; |
|
| 19 | 19 | if ($action == '') { |
| 20 | 20 | $action = 'list'; |
| 21 | 21 | } |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | </select> |
| 285 | 285 | </td> |
| 286 | 286 | <td class="labelcell">Timeout:</td> |
| 287 | - <td><input type="text" name="timeout" size="3" value="<?php if ($timeout > 0) { echo $timeout; } ?>"/></td> |
|
| 287 | + <td><input type="text" name="timeout" size="3" value="<?php if ($timeout>0) { echo $timeout; } ?>"/></td> |
|
| 288 | 288 | <td class="labelcell">Protocol:</td> |
| 289 | 289 | <td><select name="protocol" onchange="switchssl(); switchauth(); swicthcainfo();"> |
| 290 | 290 | <option value="0"<?php if ($protocol == 0) { echo ' selected="selected"'; } ?>>HTTP 1.0</option> |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | function stripslashes_deep($value) |
| 16 | 16 | { |
| 17 | 17 | $value = is_array($value) ? |
| 18 | - array_map('stripslashes_deep', $value) : |
|
| 19 | - stripslashes($value); |
|
| 18 | + array_map('stripslashes_deep', $value) : stripslashes($value); |
|
| 20 | 19 | |
| 21 | 20 | return $value; |
| 22 | 21 | } |
@@ -60,7 +59,7 @@ discard block |
||
| 60 | 59 | $path = isset($_GET['path']) ? $_GET['path'] : ''; |
| 61 | 60 | // in case user forgot initial '/' in xmlrpc server path, add it back |
| 62 | 61 | if ($path && ($path[0]) != '/') { |
| 63 | - $path = '/' . $path; |
|
| 62 | + $path = '/'.$path; |
|
| 64 | 63 | } |
| 65 | 64 | |
| 66 | 65 | if (isset($_GET['debug']) && ($_GET['debug'] == '1' || $_GET['debug'] == '2')) { |
@@ -367,7 +367,9 @@ |
||
| 367 | 367 | echo "<code>OUT: " . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: ("; |
| 368 | 368 | if ($x->count() > 1) { |
| 369 | 369 | foreach($x as $k => $y) { |
| 370 | - if ($k == 0) continue; |
|
| 370 | + if ($k == 0) { |
|
| 371 | + continue; |
|
| 372 | + } |
|
| 371 | 373 | echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
| 372 | 374 | if ($wstype != 1) { |
| 373 | 375 | $type = $y->scalarval(); |
@@ -91,15 +91,15 @@ discard block |
||
| 91 | 91 | <body> |
| 92 | 92 | <?php |
| 93 | 93 | |
| 94 | -include __DIR__ . '/common.php'; |
|
| 94 | +include __DIR__.'/common.php'; |
|
| 95 | 95 | if ($action) { |
| 96 | 96 | |
| 97 | - include_once __DIR__ . "/../src/Autoloader.php"; |
|
| 97 | + include_once __DIR__."/../src/Autoloader.php"; |
|
| 98 | 98 | PhpXmlRpc\Autoloader::register(); |
| 99 | 99 | |
| 100 | 100 | // make sure the script waits long enough for the call to complete... |
| 101 | 101 | if ($timeout) { |
| 102 | - set_time_limit($timeout + 10); |
|
| 102 | + set_time_limit($timeout+10); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | if ($wstype == 1) { |
@@ -124,13 +124,13 @@ discard block |
||
| 124 | 124 | $server = "$host$path"; |
| 125 | 125 | } |
| 126 | 126 | if ($protocol == 2) { |
| 127 | - $server = 'https://' . $server; |
|
| 127 | + $server = 'https://'.$server; |
|
| 128 | 128 | } else { |
| 129 | - $server = 'http://' . $server; |
|
| 129 | + $server = 'http://'.$server; |
|
| 130 | 130 | } |
| 131 | 131 | if ($proxy != '') { |
| 132 | 132 | $pproxy = explode(':', $proxy); |
| 133 | - if (count($pproxy) > 1) { |
|
| 133 | + if (count($pproxy)>1) { |
|
| 134 | 134 | $pport = $pproxy[1]; |
| 135 | 135 | } else { |
| 136 | 136 | $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 xml payload by hand |
| 216 | 216 | if ($wstype == 1) { |
| 217 | - $msg[0]->payload = "{\n" . |
|
| 218 | - '"method": "' . $method . "\",\n\"params\": [" . |
|
| 219 | - $payload . |
|
| 217 | + $msg[0]->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 == "") { |
@@ -229,20 +229,20 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | } else { |
| 232 | - $msg[0]->payload = $msg[0]->xml_header($inputcharset) . |
|
| 233 | - '<methodName>' . $method . "</methodName>\n<params>" . |
|
| 234 | - $payload . |
|
| 235 | - "</params>\n" . $msg[0]->xml_footer(); |
|
| 232 | + $msg[0]->payload = $msg[0]->xml_header($inputcharset). |
|
| 233 | + '<methodName>'.$method."</methodName>\n<params>". |
|
| 234 | + $payload. |
|
| 235 | + "</params>\n".$msg[0]->xml_footer(); |
|
| 236 | 236 | } |
| 237 | - $actionname = 'Execution of method ' . $method; |
|
| 237 | + $actionname = 'Execution of method '.$method; |
|
| 238 | 238 | break; |
| 239 | 239 | default: // give a warning |
| 240 | - $actionname = '[ERROR: unknown action] "' . $action . '"'; |
|
| 240 | + $actionname = '[ERROR: unknown action] "'.$action.'"'; |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | // Before calling execute, echo out brief description of action taken + date and time ??? |
| 244 | 244 | // this gives good user feedback for long-running methods... |
| 245 | - echo '<h2>' . htmlspecialchars($actionname, ENT_COMPAT, $inputcharset) . ' on server ' . htmlspecialchars($server, ENT_COMPAT, $inputcharset) . " ...</h2>\n"; |
|
| 245 | + echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset)." ...</h2>\n"; |
|
| 246 | 246 | flush(); |
| 247 | 247 | |
| 248 | 248 | $response = null; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | break; |
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | - $time = microtime(true) - $time; |
|
| 263 | + $time = microtime(true)-$time; |
|
| 264 | 264 | if ($debug) { |
| 265 | 265 | echo "</div>\n"; |
| 266 | 266 | } |
@@ -270,8 +270,8 @@ discard block |
||
| 270 | 270 | // call failed! echo out error msg! |
| 271 | 271 | //echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset).'</h2>'; |
| 272 | 272 | echo "<h3>$protoName call FAILED!</h3>\n"; |
| 273 | - echo "<p>Fault code: [" . htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
| 274 | - "] Reason: '" . htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "'</p>\n"; |
|
| 273 | + echo "<p>Fault code: [".htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
| 274 | + "] Reason: '".htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."'</p>\n"; |
|
| 275 | 275 | echo(strftime("%d/%b/%Y:%H:%M:%S\n")); |
| 276 | 276 | } else { |
| 277 | 277 | // call succeeded: parse results |
@@ -287,36 +287,36 @@ discard block |
||
| 287 | 287 | $max = $v->count(); |
| 288 | 288 | echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; |
| 289 | 289 | echo "<thead>\n<tr><th>Method ($max)</th><th>Description</th></tr>\n</thead>\n<tbody>\n"; |
| 290 | - foreach($v as $i => $rec) { |
|
| 290 | + foreach ($v as $i => $rec) { |
|
| 291 | 291 | if ($i % 2) { |
| 292 | 292 | $class = ' class="oddrow"'; |
| 293 | 293 | } else { |
| 294 | 294 | $class = ' class="evenrow"'; |
| 295 | 295 | } |
| 296 | - echo("<tr><td$class>" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">" . |
|
| 297 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 298 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 299 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 300 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 301 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
| 302 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 303 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 304 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
| 305 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
| 306 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
| 307 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 308 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 309 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 310 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 311 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
| 312 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
| 313 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 314 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
| 315 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 316 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "\" />" . |
|
| 317 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
| 318 | - "<input type=\"hidden\" name=\"action\" value=\"describe\" />" . |
|
| 319 | - "<input type=\"hidden\" name=\"run\" value=\"now\" />" . |
|
| 296 | + echo("<tr><td$class>".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">". |
|
| 297 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
| 298 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
| 299 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
| 300 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
| 301 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
| 302 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
| 303 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
| 304 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
| 305 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
| 306 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
| 307 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
| 308 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
| 309 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
| 310 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
| 311 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
| 312 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
| 313 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
| 314 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
| 315 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
| 316 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."\" />". |
|
| 317 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
| 318 | + "<input type=\"hidden\" name=\"action\" value=\"describe\" />". |
|
| 319 | + "<input type=\"hidden\" name=\"run\" value=\"now\" />". |
|
| 320 | 320 | "<input type=\"submit\" value=\"Describe\" /></form></td>"); |
| 321 | 321 | //echo("</tr>\n"); |
| 322 | 322 | |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | $r2 = $resp[1]->value(); |
| 344 | 344 | |
| 345 | 345 | echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; |
| 346 | - echo "<thead>\n<tr><th>Method</th><th>" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "</th><th> </th><th> </th></tr>\n</thead>\n<tbody>\n"; |
|
| 346 | + echo "<thead>\n<tr><th>Method</th><th>".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."</th><th> </th><th> </th></tr>\n</thead>\n<tbody>\n"; |
|
| 347 | 347 | $desc = htmlspecialchars($r1->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
| 348 | 348 | if ($desc == "") { |
| 349 | 349 | $desc = "-"; |
@@ -353,41 +353,41 @@ discard block |
||
| 353 | 353 | if ($r2->kindOf() != "array") { |
| 354 | 354 | echo "<tr><td class=\"oddrow\">Signature</td><td class=\"oddrow\">Unknown</td><td class=\"oddrow\"> </td></tr>\n"; |
| 355 | 355 | } else { |
| 356 | - foreach($r2 as $i => $x) { |
|
| 356 | + foreach ($r2 as $i => $x) { |
|
| 357 | 357 | $payload = ""; |
| 358 | 358 | $alt_payload = ""; |
| 359 | - if ($i + 1 % 2) { |
|
| 359 | + if ($i+1 % 2) { |
|
| 360 | 360 | $class = ' class="oddrow"'; |
| 361 | 361 | } else { |
| 362 | 362 | $class = ' class="evenrow"'; |
| 363 | 363 | } |
| 364 | - echo "<tr><td$class>Signature " . ($i + 1) . "</td><td$class>"; |
|
| 364 | + echo "<tr><td$class>Signature ".($i+1)."</td><td$class>"; |
|
| 365 | 365 | if ($x->kindOf() == "array") { |
| 366 | 366 | $ret = $x[0]; |
| 367 | - echo "<code>OUT: " . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: ("; |
|
| 368 | - if ($x->count() > 1) { |
|
| 369 | - foreach($x as $k => $y) { |
|
| 367 | + echo "<code>OUT: ".htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."<br />IN: ("; |
|
| 368 | + if ($x->count()>1) { |
|
| 369 | + foreach ($x as $k => $y) { |
|
| 370 | 370 | if ($k == 0) continue; |
| 371 | 371 | echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding); |
| 372 | 372 | if ($wstype != 1) { |
| 373 | 373 | $type = $y->scalarval(); |
| 374 | 374 | $payload .= '<param><value>'; |
| 375 | - switch($type) { |
|
| 375 | + switch ($type) { |
|
| 376 | 376 | case 'undefined': |
| 377 | 377 | break; |
| 378 | 378 | case 'null'; |
| 379 | 379 | $type = 'nil'; |
| 380 | 380 | // fall thru intentionally |
| 381 | 381 | default: |
| 382 | - $payload .= '<' . |
|
| 383 | - htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
| 384 | - '></' . htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . |
|
| 382 | + $payload .= '<'. |
|
| 383 | + htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
| 384 | + '></'.htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding). |
|
| 385 | 385 | '>'; |
| 386 | 386 | } |
| 387 | 387 | $payload .= "</value></param>\n"; |
| 388 | 388 | } |
| 389 | 389 | $alt_payload .= $y->scalarval(); |
| 390 | - if ($k < $x->count() - 1) { |
|
| 390 | + if ($k<$x->count()-1) { |
|
| 391 | 391 | $alt_payload .= ';'; |
| 392 | 392 | echo ", "; |
| 393 | 393 | } |
@@ -400,63 +400,63 @@ discard block |
||
| 400 | 400 | echo '</td>'; |
| 401 | 401 | // button to test this method |
| 402 | 402 | //$payload="<methodCall>\n<methodName>$method</methodName>\n<params>\n$payload</params>\n</methodCall>"; |
| 403 | - echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" . |
|
| 404 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 405 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 406 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 407 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 408 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
| 409 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 410 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 411 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
| 412 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
| 413 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
| 414 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 415 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 416 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 417 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 418 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
| 419 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
| 420 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 421 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
| 422 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 423 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 424 | - "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 425 | - "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 426 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
| 403 | + echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">". |
|
| 404 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
| 405 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
| 406 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
| 407 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
| 408 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
| 409 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
| 410 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
| 411 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
| 412 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
| 413 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
| 414 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
| 415 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
| 416 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
| 417 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
| 418 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
| 419 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
| 420 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
| 421 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
| 422 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
| 423 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />". |
|
| 424 | + "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />". |
|
| 425 | + "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />". |
|
| 426 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
| 427 | 427 | "<input type=\"hidden\" name=\"action\" value=\"execute\" />"; |
| 428 | 428 | if ($wstype != 1) { |
| 429 | 429 | echo "<input type=\"submit\" value=\"Load method synopsis\" />"; |
| 430 | 430 | } |
| 431 | 431 | echo "</form></td>\n"; |
| 432 | 432 | |
| 433 | - echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" . |
|
| 434 | - "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 435 | - "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 436 | - "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 437 | - "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 438 | - "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" . |
|
| 439 | - "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 440 | - "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 441 | - "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" . |
|
| 442 | - "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" . |
|
| 443 | - "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" . |
|
| 444 | - "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 445 | - "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 446 | - "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 447 | - "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 448 | - "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" . |
|
| 449 | - "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" . |
|
| 450 | - "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 451 | - "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" . |
|
| 452 | - "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 453 | - "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 454 | - "<input type=\"hidden\" name=\"methodsig\" value=\"" . $i . "\" />" . |
|
| 455 | - "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 456 | - "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" . |
|
| 457 | - "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" . |
|
| 458 | - "<input type=\"hidden\" name=\"run\" value=\"now\" />" . |
|
| 459 | - "<input type=\"hidden\" name=\"action\" value=\"wrap\" />" . |
|
| 433 | + echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">". |
|
| 434 | + "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />". |
|
| 435 | + "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />". |
|
| 436 | + "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />". |
|
| 437 | + "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />". |
|
| 438 | + "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />". |
|
| 439 | + "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />". |
|
| 440 | + "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />". |
|
| 441 | + "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />". |
|
| 442 | + "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />". |
|
| 443 | + "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />". |
|
| 444 | + "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />". |
|
| 445 | + "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />". |
|
| 446 | + "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />". |
|
| 447 | + "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />". |
|
| 448 | + "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />". |
|
| 449 | + "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />". |
|
| 450 | + "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />". |
|
| 451 | + "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />". |
|
| 452 | + "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />". |
|
| 453 | + "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />". |
|
| 454 | + "<input type=\"hidden\" name=\"methodsig\" value=\"".$i."\" />". |
|
| 455 | + "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />". |
|
| 456 | + "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />". |
|
| 457 | + "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />". |
|
| 458 | + "<input type=\"hidden\" name=\"run\" value=\"now\" />". |
|
| 459 | + "<input type=\"hidden\" name=\"action\" value=\"wrap\" />". |
|
| 460 | 460 | "<input type=\"submit\" value=\"Generate method call stub code\" />"; |
| 461 | 461 | echo "</form></td></tr>\n"; |
| 462 | 462 | } |
@@ -468,14 +468,14 @@ discard block |
||
| 468 | 468 | case 'wrap': |
| 469 | 469 | $r1 = $resp[0]->value(); |
| 470 | 470 | $r2 = $resp[1]->value(); |
| 471 | - if ($r2->kindOf() != "array" || $r2->count() <= $methodsig) { |
|
| 471 | + if ($r2->kindOf() != "array" || $r2->count()<=$methodsig) { |
|
| 472 | 472 | echo "Error: signature unknown\n"; |
| 473 | 473 | } else { |
| 474 | 474 | $mdesc = $r1->scalarval(); |
| 475 | 475 | $encoder = new PhpXmlRpc\Encoder(); |
| 476 | 476 | $msig = $encoder->decode($r2); |
| 477 | 477 | $msig = $msig[$methodsig]; |
| 478 | - $proto = $protocol == 2 ? 'https' : ( $protocol == 1 ? 'http11' : '' ); |
|
| 478 | + $proto = $protocol == 2 ? 'https' : ($protocol == 1 ? 'http11' : ''); |
|
| 479 | 479 | if ($proxy == '' && $username == '' && !$requestcompression && !$responsecompression && |
| 480 | 480 | $clientcookies == '' |
| 481 | 481 | ) { |
@@ -489,11 +489,11 @@ discard block |
||
| 489 | 489 | $prefix = 'xmlrpc'; |
| 490 | 490 | } |
| 491 | 491 | $wrapper = new PhpXmlRpc\Wrapper(); |
| 492 | - $code = $wrapper->buildWrapMethodSource($client, $method, array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix), str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc); |
|
| 492 | + $code = $wrapper->buildWrapMethodSource($client, $method, array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix), str_replace('.', '_', $prefix.'_'.$method), $msig, $mdesc); |
|
| 493 | 493 | //if ($code) |
| 494 | 494 | //{ |
| 495 | 495 | echo "<div id=\"phpcode\">\n"; |
| 496 | - highlight_string("<?php\n" . $code['docstring'] . $code['source'] . '?>'); |
|
| 496 | + highlight_string("<?php\n".$code['docstring'].$code['source'].'?>'); |
|
| 497 | 497 | echo "\n</div>"; |
| 498 | 498 | //} |
| 499 | 499 | //else |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | break; |
| 505 | 505 | |
| 506 | 506 | case 'execute': |
| 507 | - echo '<div id="response"><h2>Response:</h2>' . htmlspecialchars($response->serialize()) . '</div>'; |
|
| 507 | + echo '<div id="response"><h2>Response:</h2>'.htmlspecialchars($response->serialize()).'</div>'; |
|
| 508 | 508 | break; |
| 509 | 509 | |
| 510 | 510 | default: // give a warning |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | if (isset($_GET['run'])) { |
| 4 | 4 | $path = parse_url($_GET['run']); |
| 5 | 5 | if (isset($path['query'])) { |
| 6 | - $query = '?' . $path['query']; |
|
| 6 | + $query = '?'.$path['query']; |
|
| 7 | 7 | } |
| 8 | 8 | } |
| 9 | 9 | ?> |
@@ -17,8 +17,8 @@ discard block |
||
| 17 | 17 | // test for php version |
| 18 | 18 | $ver = phpversion(); |
| 19 | 19 | $tests['php_version'] = array(); |
| 20 | - $tests['php_version']['description'] = 'PHP version found: ' . $ver . ".\n\n"; |
|
| 21 | - if (version_compare($ver, '5.3.0') < 0) { |
|
| 20 | + $tests['php_version']['description'] = 'PHP version found: '.$ver.".\n\n"; |
|
| 21 | + if (version_compare($ver, '5.3.0')<0) { |
|
| 22 | 22 | $tests['php_version']['status'] = 0; |
| 23 | 23 | $tests['php_version']['description'] .= 'This version of PHP is not compatible with this release of the PHP XMLRPC library. Please upgrade to php 5.1.0 or later'; |
| 24 | 24 | } else { |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | // test for php version |
| 52 | 52 | $ver = phpversion(); |
| 53 | 53 | $tests['php_version'] = array(); |
| 54 | - $tests['php_version']['description'] = 'PHP version found: ' . $ver . ".\n\n"; |
|
| 55 | - if (version_compare($ver, '5.3.0') < 0) { |
|
| 54 | + $tests['php_version']['description'] = 'PHP version found: '.$ver.".\n\n"; |
|
| 55 | + if (version_compare($ver, '5.3.0')<0) { |
|
| 56 | 56 | $tests['php_version']['status'] = 0; |
| 57 | 57 | $tests['php_version']['description'] .= 'This version of PHP is not compatible with the PHP XMLRPC library. Please upgrade to 5.1.0 or later'; |
| 58 | 58 | } else { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $info = curl_version(); |
| 80 | 80 | $tests['curl']['status'] = 2; |
| 81 | 81 | $tests['curl']['description'] = "The cURL extension is enabled.\n\nYou will be able to send and receive messages using 'HTTPS' and 'HTTP 1.1' protocols"; |
| 82 | - if (version_compare($ver, '4.3.8') < 0) { |
|
| 82 | + if (version_compare($ver, '4.3.8')<0) { |
|
| 83 | 83 | $tests['curl']['status'] = 1; |
| 84 | 84 | $tests['curl']['description'] .= ".\nPlease note that the current cURL install does not support keep-alives"; |
| 85 | 85 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | <?php |
| 168 | 168 | $res = phpxmlrpc_verify_compat('server'); |
| 169 | 169 | foreach ($res as $test => $result) { |
| 170 | - echo '<tr><td class="res' . $result['status'] . '">' . htmlspecialchars($test) . '</td><td class="result">' . htmlspecialchars($result['description']) . "</td></tr>\n"; |
|
| 170 | + echo '<tr><td class="res'.$result['status'].'">'.htmlspecialchars($test).'</td><td class="result">'.htmlspecialchars($result['description'])."</td></tr>\n"; |
|
| 171 | 171 | } |
| 172 | 172 | ?> |
| 173 | 173 | </tbody> |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | <?php |
| 185 | 185 | $res = phpxmlrpc_verify_compat('client'); |
| 186 | 186 | foreach ($res as $test => $result) { |
| 187 | - echo '<tr><td class="res' . $result['status'] . '">' . htmlspecialchars($test) . '</td><td class="result">' . htmlspecialchars($result['description']) . "</td></tr>\n"; |
|
| 187 | + echo '<tr><td class="res'.$result['status'].'">'.htmlspecialchars($test).'</td><td class="result">'.htmlspecialchars($result['description'])."</td></tr>\n"; |
|
| 188 | 188 | } |
| 189 | 189 | ?> |
| 190 | 190 | </tbody> |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | * @license code licensed under the BSD License: see file license.txt |
| 7 | 7 | **/ |
| 8 | 8 | |
| 9 | -$coverageFile = realpath(__DIR__ . "/../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/phpunit_coverage.php"); |
|
| 9 | +$coverageFile = realpath(__DIR__."/../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/phpunit_coverage.php"); |
|
| 10 | 10 | |
| 11 | 11 | // has to be the same value as used in server.php |
| 12 | 12 | $GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] = '/tmp/phpxmlrpc_coverage'; |
@@ -209,11 +209,12 @@ |
||
| 209 | 209 | $a = $req->getParam(0); |
| 210 | 210 | $b = $req->getParam(1); |
| 211 | 211 | |
| 212 | - if ($a->scalartyp() == Value::$xmlrpcNull) |
|
| 213 | - return new PhpXmlRpc\Response(new Value(inner_findstate($b->scalarval()))); |
|
| 214 | - else |
|
| 215 | - return new PhpXmlRpc\Response(new Value(inner_findstate($a->scalarval()))); |
|
| 216 | -} |
|
| 212 | + if ($a->scalartyp() == Value::$xmlrpcNull) { |
|
| 213 | + return new PhpXmlRpc\Response(new Value(inner_findstate($b->scalarval()))); |
|
| 214 | + } else { |
|
| 215 | + return new PhpXmlRpc\Response(new Value(inner_findstate($a->scalarval()))); |
|
| 216 | + } |
|
| 217 | + } |
|
| 217 | 218 | |
| 218 | 219 | $addtwo_sig = array(array(Value::$xmlrpcInt, Value::$xmlrpcInt, Value::$xmlrpcInt)); |
| 219 | 220 | $addtwo_doc = 'Add two integers together and return the result'; |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * Please do not copy this file verbatim into your production server. |
| 10 | 10 | **/ |
| 11 | 11 | |
| 12 | -require_once __DIR__ . "/_prepend.php"; |
|
| 12 | +require_once __DIR__."/_prepend.php"; |
|
| 13 | 13 | |
| 14 | 14 | use PhpXmlRpc\Value; |
| 15 | 15 | |
@@ -105,11 +105,11 @@ discard block |
||
| 105 | 105 | // extract the value of the state number |
| 106 | 106 | $snv = $sno->scalarval(); |
| 107 | 107 | // look it up in our array (zero-based) |
| 108 | - if (isset($stateNames[$snv - 1])) { |
|
| 109 | - $stateName = $stateNames[$snv - 1]; |
|
| 108 | + if (isset($stateNames[$snv-1])) { |
|
| 109 | + $stateName = $stateNames[$snv-1]; |
|
| 110 | 110 | } else { |
| 111 | 111 | // not there, so complain |
| 112 | - $err = "I don't have a state for the index '" . $snv . "'"; |
|
| 112 | + $err = "I don't have a state for the index '".$snv."'"; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | // if we generated an error, create an error return response |
@@ -135,11 +135,11 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | global $stateNames; |
| 137 | 137 | |
| 138 | - if (isset($stateNames[$stateNo - 1])) { |
|
| 139 | - return $stateNames[$stateNo - 1]; |
|
| 138 | + if (isset($stateNames[$stateNo-1])) { |
|
| 139 | + return $stateNames[$stateNo-1]; |
|
| 140 | 140 | } else { |
| 141 | 141 | // not, there so complain |
| 142 | - throw new Exception("I don't have a state for the index '" . $stateNo . "'", PhpXmlRpc\PhpXmlRpc::$xmlrpcerruser); |
|
| 142 | + throw new Exception("I don't have a state for the index '".$stateNo."'", PhpXmlRpc\PhpXmlRpc::$xmlrpcerruser); |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
@@ -169,17 +169,17 @@ discard block |
||
| 169 | 169 | eval($findstate9_sig['source']); |
| 170 | 170 | |
| 171 | 171 | $findstate10_sig = array( |
| 172 | - "function" => function ($req) { return findState($req); }, |
|
| 172 | + "function" => function($req) { return findState($req); }, |
|
| 173 | 173 | "signature" => $findstate_sig, |
| 174 | 174 | "docstring" => $findstate_doc, |
| 175 | 175 | ); |
| 176 | 176 | |
| 177 | -$findstate11_sig = $wrapper->wrapPhpFunction(function ($stateNo) { return inner_findstate($stateNo); }); |
|
| 177 | +$findstate11_sig = $wrapper->wrapPhpFunction(function($stateNo) { return inner_findstate($stateNo); }); |
|
| 178 | 178 | |
| 179 | 179 | $c = new xmlrpcServerMethodsContainer; |
| 180 | 180 | $moreSignatures = $wrapper->wrapPhpClass($c, array('prefix' => 'tests.', 'method_type' => 'all')); |
| 181 | 181 | |
| 182 | -$returnObj_sig = $wrapper->wrapPhpFunction(array($c, 'returnObject'), '', array('encode_php_objs' => true)); |
|
| 182 | +$returnObj_sig = $wrapper->wrapPhpFunction(array($c, 'returnObject'), '', array('encode_php_objs' => true)); |
|
| 183 | 183 | |
| 184 | 184 | // used to test signatures with NULL params |
| 185 | 185 | $findstate12_sig = array( |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | $s = $req->getParam(0); |
| 206 | 206 | $t = $req->getParam(1); |
| 207 | 207 | |
| 208 | - return new PhpXmlRpc\Response(new Value($s->scalarval() + $t->scalarval(), Value::$xmlrpcInt)); |
|
| 208 | + return new PhpXmlRpc\Response(new Value($s->scalarval()+$t->scalarval(), Value::$xmlrpcInt)); |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | $addtwodouble_sig = array(array(Value::$xmlrpcDouble, Value::$xmlrpcDouble, Value::$xmlrpcDouble)); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $s = $req->getParam(0); |
| 216 | 216 | $t = $req->getParam(1); |
| 217 | 217 | |
| 218 | - return new PhpXmlRpc\Response(new Value($s->scalarval() + $t->scalarval(), Value::$xmlrpcDouble)); |
|
| 218 | + return new PhpXmlRpc\Response(new Value($s->scalarval()+$t->scalarval(), Value::$xmlrpcDouble)); |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | $stringecho_sig = array(array(Value::$xmlrpcString, Value::$xmlrpcString)); |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | function echoBack($req) |
| 232 | 232 | { |
| 233 | 233 | // just sends back a string with what i got sent to me, just escaped, that's all |
| 234 | - $s = "I got the following message:\n" . $req->serialize(); |
|
| 234 | + $s = "I got the following message:\n".$req->serialize(); |
|
| 235 | 235 | |
| 236 | 236 | return new PhpXmlRpc\Response(new Value($s)); |
| 237 | 237 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | return 0; |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | - return ($agesorter_arr[$a] > $agesorter_arr[$b]) ? -1 : 1; |
|
| 291 | + return ($agesorter_arr[$a]>$agesorter_arr[$b]) ? -1 : 1; |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | $agesorter_sig = array(array(Value::$xmlrpcArray, Value::$xmlrpcArray)); |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | // hack, must make global as uksort() won't |
| 335 | 335 | // allow us to pass any other auxiliary information |
| 336 | 336 | uksort($agesorter_arr, 'agesorter_compare'); |
| 337 | - foreach($agesorter_arr as $key => $val) { |
|
| 337 | + foreach ($agesorter_arr as $key => $val) { |
|
| 338 | 338 | // recreate each struct element |
| 339 | 339 | $v[] = new Value( |
| 340 | 340 | array( |
@@ -389,17 +389,17 @@ discard block |
||
| 389 | 389 | $err = "Error, no 'From' field specified"; |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | - $msgHdr = "From: " . $mFrom->scalarval() . "\n"; |
|
| 393 | - $msgHdr .= "To: " . $mTo->scalarval() . "\n"; |
|
| 392 | + $msgHdr = "From: ".$mFrom->scalarval()."\n"; |
|
| 393 | + $msgHdr .= "To: ".$mTo->scalarval()."\n"; |
|
| 394 | 394 | |
| 395 | 395 | if ($mCc->scalarval() != "") { |
| 396 | - $msgHdr .= "Cc: " . $mCc->scalarval() . "\n"; |
|
| 396 | + $msgHdr .= "Cc: ".$mCc->scalarval()."\n"; |
|
| 397 | 397 | } |
| 398 | 398 | if ($mBcc->scalarval() != "") { |
| 399 | - $msgHdr .= "Bcc: " . $mBcc->scalarval() . "\n"; |
|
| 399 | + $msgHdr .= "Bcc: ".$mBcc->scalarval()."\n"; |
|
| 400 | 400 | } |
| 401 | 401 | if ($mMime->scalarval() != "") { |
| 402 | - $msgHdr .= "Content-type: " . $mMime->scalarval() . "\n"; |
|
| 402 | + $msgHdr .= "Content-type: ".$mMime->scalarval()."\n"; |
|
| 403 | 403 | } |
| 404 | 404 | $msgHdr .= "X-Mailer: XML-RPC for PHP mailer 1.0"; |
| 405 | 405 | |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | $moe = $sno["moe"]; |
| 490 | 490 | $larry = $sno["larry"]; |
| 491 | 491 | $curly = $sno["curly"]; |
| 492 | - $num = $moe->scalarval() + $larry->scalarval() + $curly->scalarval(); |
|
| 492 | + $num = $moe->scalarval()+$larry->scalarval()+$curly->scalarval(); |
|
| 493 | 493 | |
| 494 | 494 | return new PhpXmlRpc\Response(new Value($num, Value::$xmlrpcInt)); |
| 495 | 495 | } |
@@ -531,9 +531,9 @@ discard block |
||
| 531 | 531 | $ar = $req->getParam(0); |
| 532 | 532 | $sz = $ar->count(); |
| 533 | 533 | $first = $ar[0]; |
| 534 | - $last = $ar[$sz - 1]; |
|
| 534 | + $last = $ar[$sz-1]; |
|
| 535 | 535 | |
| 536 | - return new PhpXmlRpc\Response(new Value($first->scalarval() . |
|
| 536 | + return new PhpXmlRpc\Response(new Value($first->scalarval(). |
|
| 537 | 537 | $last->scalarval(), Value::$xmlrpcString)); |
| 538 | 538 | } |
| 539 | 539 | |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | $larry = $fools["larry"]; |
| 568 | 568 | $moe = $fools["moe"]; |
| 569 | 569 | |
| 570 | - return new PhpXmlRpc\Response(new Value($curly->scalarval() + $larry->scalarval() + $moe->scalarval(), Value::$xmlrpcInt)); |
|
| 570 | + return new PhpXmlRpc\Response(new Value($curly->scalarval()+$larry->scalarval()+$moe->scalarval(), Value::$xmlrpcInt)); |
|
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | $v1_countTheEntities_sig = array(array(Value::$xmlrpcStruct, Value::$xmlrpcString)); |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | $ap = 0; |
| 582 | 582 | $qu = 0; |
| 583 | 583 | $amp = 0; |
| 584 | - for ($i = 0; $i < strlen($str); $i++) { |
|
| 584 | + for ($i = 0; $i<strlen($str); $i++) { |
|
| 585 | 585 | $c = substr($str, $i, 1); |
| 586 | 586 | switch ($c) { |
| 587 | 587 | case ">": |
@@ -783,7 +783,7 @@ discard block |
||
| 783 | 783 | ), |
| 784 | 784 | // Greek word 'kosme'. NB: NOT a valid ISO8859 string! |
| 785 | 785 | // NB: we can only register this when setting internal encoding to UTF-8, or it will break system.listMethods |
| 786 | - "tests.utf8methodname." . 'κόσμε' => array( |
|
| 786 | + "tests.utf8methodname.".'κόσμε' => array( |
|
| 787 | 787 | "function" => "stringEcho", |
| 788 | 788 | "signature" => $stringecho_sig, |
| 789 | 789 | "docstring" => $stringecho_doc, |
@@ -976,4 +976,4 @@ discard block |
||
| 976 | 976 | $s->service(); |
| 977 | 977 | // That should do all we need! |
| 978 | 978 | |
| 979 | -require_once __DIR__ . "/_append.php"; |
|
| 979 | +require_once __DIR__."/_append.php"; |
|
@@ -561,8 +561,9 @@ discard block |
||
| 561 | 561 | } |
| 562 | 562 | foreach ($parsVariations as $i => $pars) { |
| 563 | 563 | $innerCode .= "if (\$paramCount == " . count($pars) . ") \$retval = {$catchWarnings}$realFuncName(" . implode(',', $pars) . ");\n"; |
| 564 | - if ($i < (count($parsVariations) - 1)) |
|
| 565 | - $innerCode .= "else\n"; |
|
| 564 | + if ($i < (count($parsVariations) - 1)) { |
|
| 565 | + $innerCode .= "else\n"; |
|
| 566 | + } |
|
| 566 | 567 | } |
| 567 | 568 | $innerCode .= "if (is_a(\$retval, '{$namespace}Response')) return \$retval; else\n"; |
| 568 | 569 | if ($funcDesc['returns'] == Value::$xmlrpcDateTime || $funcDesc['returns'] == Value::$xmlrpcBase64) { |
@@ -615,7 +616,7 @@ discard block |
||
| 615 | 616 | if ($methodWrap) { |
| 616 | 617 | if (is_object($className)) { |
| 617 | 618 | $realClassName = get_class($className); |
| 618 | - }else { |
|
| 619 | + } else { |
|
| 619 | 620 | $realClassName = $className; |
| 620 | 621 | } |
| 621 | 622 | $results[$prefix."$realClassName.$mName"] = $methodWrap; |
@@ -159,20 +159,20 @@ discard block |
||
| 159 | 159 | $callable = explode('::', $callable); |
| 160 | 160 | } |
| 161 | 161 | if (is_array($callable)) { |
| 162 | - if (count($callable) < 2 || (!is_string($callable[0]) && !is_object($callable[0]))) { |
|
| 163 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': syntax for function to be wrapped is wrong'); |
|
| 162 | + if (count($callable)<2 || (!is_string($callable[0]) && !is_object($callable[0]))) { |
|
| 163 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': syntax for function to be wrapped is wrong'); |
|
| 164 | 164 | return false; |
| 165 | 165 | } |
| 166 | 166 | if (is_string($callable[0])) { |
| 167 | 167 | $plainFuncName = implode('::', $callable); |
| 168 | 168 | } elseif (is_object($callable[0])) { |
| 169 | - $plainFuncName = get_class($callable[0]) . '->' . $callable[1]; |
|
| 169 | + $plainFuncName = get_class($callable[0]).'->'.$callable[1]; |
|
| 170 | 170 | } |
| 171 | 171 | $exists = method_exists($callable[0], $callable[1]); |
| 172 | 172 | } else if ($callable instanceof \Closure) { |
| 173 | 173 | // we do not support creating code which wraps closures, as php does not allow to serialize them |
| 174 | 174 | if (!$buildIt) { |
| 175 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': a closure can not be wrapped in generated source code'); |
|
| 175 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': a closure can not be wrapped in generated source code'); |
|
| 176 | 176 | return false; |
| 177 | 177 | } |
| 178 | 178 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | if (!$exists) { |
| 187 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': function to be wrapped is not defined: ' . $plainFuncName); |
|
| 187 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': function to be wrapped is not defined: '.$plainFuncName); |
|
| 188 | 188 | return false; |
| 189 | 189 | } |
| 190 | 190 | |
@@ -228,23 +228,23 @@ discard block |
||
| 228 | 228 | if (is_array($callable)) { |
| 229 | 229 | $func = new \ReflectionMethod($callable[0], $callable[1]); |
| 230 | 230 | if ($func->isPrivate()) { |
| 231 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': method to be wrapped is private: ' . $plainFuncName); |
|
| 231 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': method to be wrapped is private: '.$plainFuncName); |
|
| 232 | 232 | return false; |
| 233 | 233 | } |
| 234 | 234 | if ($func->isProtected()) { |
| 235 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': method to be wrapped is protected: ' . $plainFuncName); |
|
| 235 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': method to be wrapped is protected: '.$plainFuncName); |
|
| 236 | 236 | return false; |
| 237 | 237 | } |
| 238 | 238 | if ($func->isConstructor()) { |
| 239 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': method to be wrapped is the constructor: ' . $plainFuncName); |
|
| 239 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': method to be wrapped is the constructor: '.$plainFuncName); |
|
| 240 | 240 | return false; |
| 241 | 241 | } |
| 242 | 242 | if ($func->isDestructor()) { |
| 243 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': method to be wrapped is the destructor: ' . $plainFuncName); |
|
| 243 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': method to be wrapped is the destructor: '.$plainFuncName); |
|
| 244 | 244 | return false; |
| 245 | 245 | } |
| 246 | 246 | if ($func->isAbstract()) { |
| 247 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': method to be wrapped is abstract: ' . $plainFuncName); |
|
| 247 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': method to be wrapped is abstract: '.$plainFuncName); |
|
| 248 | 248 | return false; |
| 249 | 249 | } |
| 250 | 250 | /// @todo add more checks for static vs. nonstatic? |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | if ($func->isInternal()) { |
| 255 | 255 | // Note: from PHP 5.1.0 onward, we will possibly be able to use invokeargs |
| 256 | 256 | // instead of getparameters to fully reflect internal php functions ? |
| 257 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': function to be wrapped is internal: ' . $plainFuncName); |
|
| 257 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': function to be wrapped is internal: '.$plainFuncName); |
|
| 258 | 258 | return false; |
| 259 | 259 | } |
| 260 | 260 | |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | $i = 0; |
| 307 | 307 | foreach ($func->getParameters() as $paramObj) { |
| 308 | 308 | $params[$i] = array(); |
| 309 | - $params[$i]['name'] = '$' . $paramObj->getName(); |
|
| 309 | + $params[$i]['name'] = '$'.$paramObj->getName(); |
|
| 310 | 310 | $params[$i]['isoptional'] = $paramObj->isOptional(); |
| 311 | 311 | $i++; |
| 312 | 312 | } |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | // build a signature |
| 372 | 372 | $sig = array($this->php2XmlrpcType($funcDesc['returns'])); |
| 373 | 373 | $pSig = array($funcDesc['returnsDocs']); |
| 374 | - for ($i = 0; $i < count($pars); $i++) { |
|
| 374 | + for ($i = 0; $i<count($pars); $i++) { |
|
| 375 | 375 | $name = strtolower($funcDesc['params'][$i]['name']); |
| 376 | 376 | if (isset($funcDesc['paramDocs'][$name]['type'])) { |
| 377 | 377 | $sig[] = $this->php2XmlrpcType($funcDesc['paramDocs'][$name]['type']); |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | } |
| 427 | 427 | } |
| 428 | 428 | $numPars = $req->getNumParams(); |
| 429 | - if ($numPars < $minPars || $numPars > $maxPars) { |
|
| 429 | + if ($numPars<$minPars || $numPars>$maxPars) { |
|
| 430 | 430 | return new $responseClass(0, 3, 'Incorrect parameters passed to method'); |
| 431 | 431 | } |
| 432 | 432 | |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | |
| 440 | 440 | $result = call_user_func_array($callable, $params); |
| 441 | 441 | |
| 442 | - if (! is_a($result, $responseClass)) { |
|
| 442 | + if (!is_a($result, $responseClass)) { |
|
| 443 | 443 | if ($funcDesc['returns'] == Value::$xmlrpcDateTime || $funcDesc['returns'] == Value::$xmlrpcBase64) { |
| 444 | 444 | $result = new $valueClass($result, $funcDesc['returns']); |
| 445 | 445 | } else { |
@@ -474,9 +474,9 @@ discard block |
||
| 474 | 474 | if ($newFuncName == '') { |
| 475 | 475 | if (is_array($callable)) { |
| 476 | 476 | if (is_string($callable[0])) { |
| 477 | - $xmlrpcFuncName = "{$prefix}_" . implode('_', $callable); |
|
| 477 | + $xmlrpcFuncName = "{$prefix}_".implode('_', $callable); |
|
| 478 | 478 | } else { |
| 479 | - $xmlrpcFuncName = "{$prefix}_" . get_class($callable[0]) . '_' . $callable[1]; |
|
| 479 | + $xmlrpcFuncName = "{$prefix}_".get_class($callable[0]).'_'.$callable[1]; |
|
| 480 | 480 | } |
| 481 | 481 | } else { |
| 482 | 482 | if ($callable instanceof \Closure) { |
@@ -512,8 +512,8 @@ discard block |
||
| 512 | 512 | { |
| 513 | 513 | $namespace = '\\PhpXmlRpc\\'; |
| 514 | 514 | |
| 515 | - $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool)$extraOptions['encode_php_objs'] : false; |
|
| 516 | - $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool)$extraOptions['decode_php_objs'] : false; |
|
| 515 | + $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool) $extraOptions['encode_php_objs'] : false; |
|
| 516 | + $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool) $extraOptions['decode_php_objs'] : false; |
|
| 517 | 517 | $catchWarnings = isset($extraOptions['suppress_warnings']) && $extraOptions['suppress_warnings'] ? '@' : ''; |
| 518 | 518 | |
| 519 | 519 | $i = 0; |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | // build body of new function |
| 549 | 549 | |
| 550 | 550 | $innerCode = "\$paramCount = \$req->getNumParams();\n"; |
| 551 | - $innerCode .= "if (\$paramCount < $minPars || \$paramCount > $maxPars) return new {$namespace}Response(0, " . PhpXmlRpc::$xmlrpcerr['incorrect_params'] . ", '" . PhpXmlRpc::$xmlrpcstr['incorrect_params'] . "');\n"; |
|
| 551 | + $innerCode .= "if (\$paramCount < $minPars || \$paramCount > $maxPars) return new {$namespace}Response(0, ".PhpXmlRpc::$xmlrpcerr['incorrect_params'].", '".PhpXmlRpc::$xmlrpcstr['incorrect_params']."');\n"; |
|
| 552 | 552 | |
| 553 | 553 | $innerCode .= "\$encoder = new {$namespace}Encoder();\n"; |
| 554 | 554 | if ($decodePhpObjects) { |
@@ -562,13 +562,13 @@ discard block |
||
| 562 | 562 | if (is_array($callable) && is_object($callable[0])) { |
| 563 | 563 | self::$objHolder[$newFuncName] = $callable[0]; |
| 564 | 564 | $innerCode .= "\$obj = PhpXmlRpc\\Wrapper::\$objHolder['$newFuncName'];\n"; |
| 565 | - $realFuncName = '$obj->' . $callable[1]; |
|
| 565 | + $realFuncName = '$obj->'.$callable[1]; |
|
| 566 | 566 | } else { |
| 567 | 567 | $realFuncName = $plainFuncName; |
| 568 | 568 | } |
| 569 | 569 | foreach ($parsVariations as $i => $pars) { |
| 570 | - $innerCode .= "if (\$paramCount == " . count($pars) . ") \$retval = {$catchWarnings}$realFuncName(" . implode(',', $pars) . ");\n"; |
|
| 571 | - if ($i < (count($parsVariations) - 1)) |
|
| 570 | + $innerCode .= "if (\$paramCount == ".count($pars).") \$retval = {$catchWarnings}$realFuncName(".implode(',', $pars).");\n"; |
|
| 571 | + if ($i<(count($parsVariations)-1)) |
|
| 572 | 572 | $innerCode .= "else\n"; |
| 573 | 573 | } |
| 574 | 574 | $innerCode .= "if (is_a(\$retval, '{$namespace}Response')) return \$retval; else\n"; |
@@ -585,7 +585,7 @@ discard block |
||
| 585 | 585 | // if($func->returnsReference()) |
| 586 | 586 | // return false; |
| 587 | 587 | |
| 588 | - $code = "function $newFuncName(\$req) {\n" . $innerCode . "\n}"; |
|
| 588 | + $code = "function $newFuncName(\$req) {\n".$innerCode."\n}"; |
|
| 589 | 589 | |
| 590 | 590 | return $code; |
| 591 | 591 | } |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | if ($methodWrap) { |
| 623 | 623 | if (is_object($className)) { |
| 624 | 624 | $realClassName = get_class($className); |
| 625 | - }else { |
|
| 625 | + } else { |
|
| 626 | 626 | $realClassName = $className; |
| 627 | 627 | } |
| 628 | 628 | $results[$prefix."$realClassName.$mName"] = $methodWrap; |
@@ -723,21 +723,21 @@ discard block |
||
| 723 | 723 | protected function retrieveMethodSignature($client, $methodName, array $extraOptions = array()) |
| 724 | 724 | { |
| 725 | 725 | $namespace = '\\PhpXmlRpc\\'; |
| 726 | - $reqClass = $namespace . 'Request'; |
|
| 727 | - $valClass = $namespace . 'Value'; |
|
| 728 | - $decoderClass = $namespace . 'Encoder'; |
|
| 726 | + $reqClass = $namespace.'Request'; |
|
| 727 | + $valClass = $namespace.'Value'; |
|
| 728 | + $decoderClass = $namespace.'Encoder'; |
|
| 729 | 729 | |
| 730 | 730 | $debug = isset($extraOptions['debug']) ? ($extraOptions['debug']) : 0; |
| 731 | - $timeout = isset($extraOptions['timeout']) ? (int)$extraOptions['timeout'] : 0; |
|
| 731 | + $timeout = isset($extraOptions['timeout']) ? (int) $extraOptions['timeout'] : 0; |
|
| 732 | 732 | $protocol = isset($extraOptions['protocol']) ? $extraOptions['protocol'] : ''; |
| 733 | - $sigNum = isset($extraOptions['signum']) ? (int)$extraOptions['signum'] : 0; |
|
| 733 | + $sigNum = isset($extraOptions['signum']) ? (int) $extraOptions['signum'] : 0; |
|
| 734 | 734 | |
| 735 | 735 | $req = new $reqClass('system.methodSignature'); |
| 736 | 736 | $req->addparam(new $valClass($methodName)); |
| 737 | 737 | $client->setDebug($debug); |
| 738 | 738 | $response = $client->send($req, $timeout, $protocol); |
| 739 | 739 | if ($response->faultCode()) { |
| 740 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': could not retrieve method signature from remote server for method ' . $methodName); |
|
| 740 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': could not retrieve method signature from remote server for method '.$methodName); |
|
| 741 | 741 | return false; |
| 742 | 742 | } |
| 743 | 743 | |
@@ -747,8 +747,8 @@ discard block |
||
| 747 | 747 | $mSig = $decoder->decode($mSig); |
| 748 | 748 | } |
| 749 | 749 | |
| 750 | - if (!is_array($mSig) || count($mSig) <= $sigNum) { |
|
| 751 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': could not retrieve method signature nr.' . $sigNum . ' from remote server for method ' . $methodName); |
|
| 750 | + if (!is_array($mSig) || count($mSig)<=$sigNum) { |
|
| 751 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': could not retrieve method signature nr.'.$sigNum.' from remote server for method '.$methodName); |
|
| 752 | 752 | return false; |
| 753 | 753 | } |
| 754 | 754 | |
@@ -764,11 +764,11 @@ discard block |
||
| 764 | 764 | protected function retrieveMethodHelp($client, $methodName, array $extraOptions = array()) |
| 765 | 765 | { |
| 766 | 766 | $namespace = '\\PhpXmlRpc\\'; |
| 767 | - $reqClass = $namespace . 'Request'; |
|
| 768 | - $valClass = $namespace . 'Value'; |
|
| 767 | + $reqClass = $namespace.'Request'; |
|
| 768 | + $valClass = $namespace.'Value'; |
|
| 769 | 769 | |
| 770 | 770 | $debug = isset($extraOptions['debug']) ? ($extraOptions['debug']) : 0; |
| 771 | - $timeout = isset($extraOptions['timeout']) ? (int)$extraOptions['timeout'] : 0; |
|
| 771 | + $timeout = isset($extraOptions['timeout']) ? (int) $extraOptions['timeout'] : 0; |
|
| 772 | 772 | $protocol = isset($extraOptions['protocol']) ? $extraOptions['protocol'] : ''; |
| 773 | 773 | |
| 774 | 774 | $mDesc = ''; |
@@ -802,10 +802,10 @@ discard block |
||
| 802 | 802 | $clientClone = clone $client; |
| 803 | 803 | $function = function() use($clientClone, $methodName, $extraOptions, $mSig) |
| 804 | 804 | { |
| 805 | - $timeout = isset($extraOptions['timeout']) ? (int)$extraOptions['timeout'] : 0; |
|
| 805 | + $timeout = isset($extraOptions['timeout']) ? (int) $extraOptions['timeout'] : 0; |
|
| 806 | 806 | $protocol = isset($extraOptions['protocol']) ? $extraOptions['protocol'] : ''; |
| 807 | - $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool)$extraOptions['encode_php_objs'] : false; |
|
| 808 | - $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool)$extraOptions['decode_php_objs'] : false; |
|
| 807 | + $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool) $extraOptions['encode_php_objs'] : false; |
|
| 808 | + $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool) $extraOptions['decode_php_objs'] : false; |
|
| 809 | 809 | if (isset($extraOptions['return_on_fault'])) { |
| 810 | 810 | $decodeFault = true; |
| 811 | 811 | $faultResponse = $extraOptions['return_on_fault']; |
@@ -814,9 +814,9 @@ discard block |
||
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | $namespace = '\\PhpXmlRpc\\'; |
| 817 | - $reqClass = $namespace . 'Request'; |
|
| 818 | - $encoderClass = $namespace . 'Encoder'; |
|
| 819 | - $valueClass = $namespace . 'Value'; |
|
| 817 | + $reqClass = $namespace.'Request'; |
|
| 818 | + $encoderClass = $namespace.'Encoder'; |
|
| 819 | + $valueClass = $namespace.'Value'; |
|
| 820 | 820 | |
| 821 | 821 | $encoder = new $encoderClass(); |
| 822 | 822 | $encodeOptions = array(); |
@@ -839,7 +839,7 @@ discard block |
||
| 839 | 839 | } |
| 840 | 840 | |
| 841 | 841 | $xmlrpcArgs = array(); |
| 842 | - foreach($currentArgs as $i => $arg) { |
|
| 842 | + foreach ($currentArgs as $i => $arg) { |
|
| 843 | 843 | if ($i == $maxArgs) { |
| 844 | 844 | break; |
| 845 | 845 | } |
@@ -887,13 +887,13 @@ discard block |
||
| 887 | 887 | * @param string $mDesc |
| 888 | 888 | * @return string[] keys: source, docstring |
| 889 | 889 | */ |
| 890 | - public function buildWrapMethodSource($client, $methodName, array $extraOptions, $newFuncName, $mSig, $mDesc='') |
|
| 890 | + public function buildWrapMethodSource($client, $methodName, array $extraOptions, $newFuncName, $mSig, $mDesc = '') |
|
| 891 | 891 | { |
| 892 | - $timeout = isset($extraOptions['timeout']) ? (int)$extraOptions['timeout'] : 0; |
|
| 892 | + $timeout = isset($extraOptions['timeout']) ? (int) $extraOptions['timeout'] : 0; |
|
| 893 | 893 | $protocol = isset($extraOptions['protocol']) ? $extraOptions['protocol'] : ''; |
| 894 | - $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool)$extraOptions['encode_php_objs'] : false; |
|
| 895 | - $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool)$extraOptions['decode_php_objs'] : false; |
|
| 896 | - $clientCopyMode = isset($extraOptions['simple_client_copy']) ? (int)($extraOptions['simple_client_copy']) : 0; |
|
| 894 | + $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool) $extraOptions['encode_php_objs'] : false; |
|
| 895 | + $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool) $extraOptions['decode_php_objs'] : false; |
|
| 896 | + $clientCopyMode = isset($extraOptions['simple_client_copy']) ? (int) ($extraOptions['simple_client_copy']) : 0; |
|
| 897 | 897 | $prefix = isset($extraOptions['prefix']) ? $extraOptions['prefix'] : 'xmlrpc'; |
| 898 | 898 | if (isset($extraOptions['return_on_fault'])) { |
| 899 | 899 | $decodeFault = true; |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | $namespace = '\\PhpXmlRpc\\'; |
| 907 | 907 | |
| 908 | 908 | $code = "function $newFuncName ("; |
| 909 | - if ($clientCopyMode < 2) { |
|
| 909 | + if ($clientCopyMode<2) { |
|
| 910 | 910 | // client copy mode 0 or 1 == full / partial client copy in emitted code |
| 911 | 911 | $verbatimClientCopy = !$clientCopyMode; |
| 912 | 912 | $innerCode = $this->buildClientWrapperCode($client, $verbatimClientCopy, $prefix, $namespace); |
@@ -921,7 +921,7 @@ discard block |
||
| 921 | 921 | |
| 922 | 922 | if ($mDesc != '') { |
| 923 | 923 | // take care that PHP comment is not terminated unwillingly by method description |
| 924 | - $mDesc = "/**\n* " . str_replace('*/', '* /', $mDesc) . "\n"; |
|
| 924 | + $mDesc = "/**\n* ".str_replace('*/', '* /', $mDesc)."\n"; |
|
| 925 | 925 | } else { |
| 926 | 926 | $mDesc = "/**\nFunction $newFuncName\n"; |
| 927 | 927 | } |
@@ -930,7 +930,7 @@ discard block |
||
| 930 | 930 | $innerCode .= "\$encoder = new {$namespace}Encoder();\n"; |
| 931 | 931 | $plist = array(); |
| 932 | 932 | $pCount = count($mSig); |
| 933 | - for ($i = 1; $i < $pCount; $i++) { |
|
| 933 | + for ($i = 1; $i<$pCount; $i++) { |
|
| 934 | 934 | $plist[] = "\$p$i"; |
| 935 | 935 | $pType = $mSig[$i]; |
| 936 | 936 | if ($pType == 'i4' || $pType == 'i8' || $pType == 'int' || $pType == 'boolean' || $pType == 'double' || |
@@ -946,19 +946,19 @@ discard block |
||
| 946 | 946 | } |
| 947 | 947 | } |
| 948 | 948 | $innerCode .= "\$req->addparam(\$p$i);\n"; |
| 949 | - $mDesc .= '* @param ' . $this->xmlrpc2PhpType($pType) . " \$p$i\n"; |
|
| 949 | + $mDesc .= '* @param '.$this->xmlrpc2PhpType($pType)." \$p$i\n"; |
|
| 950 | 950 | } |
| 951 | - if ($clientCopyMode < 2) { |
|
| 951 | + if ($clientCopyMode<2) { |
|
| 952 | 952 | $plist[] = '$debug=0'; |
| 953 | 953 | $mDesc .= "* @param int \$debug when 1 (or 2) will enable debugging of the underlying {$prefix} call (defaults to 0)\n"; |
| 954 | 954 | } |
| 955 | 955 | $plist = implode(', ', $plist); |
| 956 | - $mDesc .= '* @return ' . $this->xmlrpc2PhpType($mSig[0]) . " (or an {$namespace}Response obj instance if call fails)\n*/\n"; |
|
| 956 | + $mDesc .= '* @return '.$this->xmlrpc2PhpType($mSig[0])." (or an {$namespace}Response obj instance if call fails)\n*/\n"; |
|
| 957 | 957 | |
| 958 | 958 | $innerCode .= "\$res = \${$this_}client->send(\$req, $timeout, '$protocol');\n"; |
| 959 | 959 | if ($decodeFault) { |
| 960 | 960 | if (is_string($faultResponse) && ((strpos($faultResponse, '%faultCode%') !== false) || (strpos($faultResponse, '%faultString%') !== false))) { |
| 961 | - $respCode = "str_replace(array('%faultCode%', '%faultString%'), array(\$res->faultCode(), \$res->faultString()), '" . str_replace("'", "''", $faultResponse) . "')"; |
|
| 961 | + $respCode = "str_replace(array('%faultCode%', '%faultString%'), array(\$res->faultCode(), \$res->faultString()), '".str_replace("'", "''", $faultResponse)."')"; |
|
| 962 | 962 | } else { |
| 963 | 963 | $respCode = var_export($faultResponse, true); |
| 964 | 964 | } |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | $innerCode .= "if (\$res->faultcode()) return $respCode; else return \$encoder->decode(\$res->value());"; |
| 972 | 972 | } |
| 973 | 973 | |
| 974 | - $code = $code . $plist . ") {\n" . $innerCode . "\n}\n"; |
|
| 974 | + $code = $code.$plist.") {\n".$innerCode."\n}\n"; |
|
| 975 | 975 | |
| 976 | 976 | return array('source' => $code, 'docstring' => $mDesc); |
| 977 | 977 | } |
@@ -997,23 +997,23 @@ discard block |
||
| 997 | 997 | public function wrapXmlrpcServer($client, $extraOptions = array()) |
| 998 | 998 | { |
| 999 | 999 | $methodFilter = isset($extraOptions['method_filter']) ? $extraOptions['method_filter'] : ''; |
| 1000 | - $timeout = isset($extraOptions['timeout']) ? (int)$extraOptions['timeout'] : 0; |
|
| 1000 | + $timeout = isset($extraOptions['timeout']) ? (int) $extraOptions['timeout'] : 0; |
|
| 1001 | 1001 | $protocol = isset($extraOptions['protocol']) ? $extraOptions['protocol'] : ''; |
| 1002 | 1002 | $newClassName = isset($extraOptions['new_class_name']) ? $extraOptions['new_class_name'] : ''; |
| 1003 | - $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool)$extraOptions['encode_php_objs'] : false; |
|
| 1004 | - $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool)$extraOptions['decode_php_objs'] : false; |
|
| 1003 | + $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool) $extraOptions['encode_php_objs'] : false; |
|
| 1004 | + $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool) $extraOptions['decode_php_objs'] : false; |
|
| 1005 | 1005 | $verbatimClientCopy = isset($extraOptions['simple_client_copy']) ? !($extraOptions['simple_client_copy']) : true; |
| 1006 | 1006 | $buildIt = isset($extraOptions['return_source']) ? !($extraOptions['return_source']) : true; |
| 1007 | 1007 | $prefix = isset($extraOptions['prefix']) ? $extraOptions['prefix'] : 'xmlrpc'; |
| 1008 | 1008 | $namespace = '\\PhpXmlRpc\\'; |
| 1009 | 1009 | |
| 1010 | - $reqClass = $namespace . 'Request'; |
|
| 1011 | - $decoderClass = $namespace . 'Encoder'; |
|
| 1010 | + $reqClass = $namespace.'Request'; |
|
| 1011 | + $decoderClass = $namespace.'Encoder'; |
|
| 1012 | 1012 | |
| 1013 | 1013 | $req = new $reqClass('system.listMethods'); |
| 1014 | 1014 | $response = $client->send($req, $timeout, $protocol); |
| 1015 | 1015 | if ($response->faultCode()) { |
| 1016 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': could not retrieve method list from remote server'); |
|
| 1016 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': could not retrieve method list from remote server'); |
|
| 1017 | 1017 | |
| 1018 | 1018 | return false; |
| 1019 | 1019 | } else { |
@@ -1023,7 +1023,7 @@ discard block |
||
| 1023 | 1023 | $mList = $decoder->decode($mList); |
| 1024 | 1024 | } |
| 1025 | 1025 | if (!is_array($mList) || !count($mList)) { |
| 1026 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': could not retrieve meaningful method list from remote server'); |
|
| 1026 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': could not retrieve meaningful method list from remote server'); |
|
| 1027 | 1027 | |
| 1028 | 1028 | return false; |
| 1029 | 1029 | } else { |
@@ -1031,8 +1031,8 @@ discard block |
||
| 1031 | 1031 | if ($newClassName != '') { |
| 1032 | 1032 | $xmlrpcClassName = $newClassName; |
| 1033 | 1033 | } else { |
| 1034 | - $xmlrpcClassName = $prefix . '_' . preg_replace(array('/\./', '/[^a-zA-Z0-9_\x7f-\xff]/'), |
|
| 1035 | - array('_', ''), $client->server) . '_client'; |
|
| 1034 | + $xmlrpcClassName = $prefix.'_'.preg_replace(array('/\./', '/[^a-zA-Z0-9_\x7f-\xff]/'), |
|
| 1035 | + array('_', ''), $client->server).'_client'; |
|
| 1036 | 1036 | } |
| 1037 | 1037 | while ($buildIt && class_exists($xmlrpcClassName)) { |
| 1038 | 1038 | $xmlrpcClassName .= 'x'; |
@@ -1063,20 +1063,20 @@ discard block |
||
| 1063 | 1063 | if (!$buildIt) { |
| 1064 | 1064 | $source .= $methodWrap['docstring']; |
| 1065 | 1065 | } |
| 1066 | - $source .= $methodWrap['source'] . "\n"; |
|
| 1066 | + $source .= $methodWrap['source']."\n"; |
|
| 1067 | 1067 | } else { |
| 1068 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': will not create class method to wrap remote method ' . $mName); |
|
| 1068 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': will not create class method to wrap remote method '.$mName); |
|
| 1069 | 1069 | } |
| 1070 | 1070 | } |
| 1071 | 1071 | } |
| 1072 | 1072 | $source .= "}\n"; |
| 1073 | 1073 | if ($buildIt) { |
| 1074 | 1074 | $allOK = 0; |
| 1075 | - eval($source . '$allOK=1;'); |
|
| 1075 | + eval($source.'$allOK=1;'); |
|
| 1076 | 1076 | if ($allOK) { |
| 1077 | 1077 | return $xmlrpcClassName; |
| 1078 | 1078 | } else { |
| 1079 | - Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': could not create class ' . $xmlrpcClassName . ' to wrap remote server ' . $client->server); |
|
| 1079 | + Logger::instance()->errorLog('XML-RPC: '.__METHOD__.': could not create class '.$xmlrpcClassName.' to wrap remote server '.$client->server); |
|
| 1080 | 1080 | return false; |
| 1081 | 1081 | } |
| 1082 | 1082 | } else { |
@@ -1097,10 +1097,10 @@ discard block |
||
| 1097 | 1097 | * |
| 1098 | 1098 | * @return string |
| 1099 | 1099 | */ |
| 1100 | - protected function buildClientWrapperCode($client, $verbatimClientCopy, $prefix = 'xmlrpc', $namespace = '\\PhpXmlRpc\\' ) |
|
| 1100 | + protected function buildClientWrapperCode($client, $verbatimClientCopy, $prefix = 'xmlrpc', $namespace = '\\PhpXmlRpc\\') |
|
| 1101 | 1101 | { |
| 1102 | - $code = "\$client = new {$namespace}Client('" . str_replace("'", "\'", $client->path) . |
|
| 1103 | - "', '" . str_replace("'", "\'", $client->server) . "', $client->port);\n"; |
|
| 1102 | + $code = "\$client = new {$namespace}Client('".str_replace("'", "\'", $client->path). |
|
| 1103 | + "', '".str_replace("'", "\'", $client->server)."', $client->port);\n"; |
|
| 1104 | 1104 | |
| 1105 | 1105 | // copy all client fields to the client that will be generated runtime |
| 1106 | 1106 | // (this provides for future expansion or subclassing of client obj) |