@@ -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); |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Makefile for phpxmlrpc library. |
|
| 4 | - * To be used with the Pake tool: https://github.com/indeyets/pake/wiki |
|
| 5 | - * |
|
| 6 | - * @copyright (c) 2015 G. Giunta |
|
| 7 | - * |
|
| 8 | - * @todo !important allow user to specify location of docbook xslt instead of the one installed via composer |
|
| 9 | - */ |
|
| 3 | + * Makefile for phpxmlrpc library. |
|
| 4 | + * To be used with the Pake tool: https://github.com/indeyets/pake/wiki |
|
| 5 | + * |
|
| 6 | + * @copyright (c) 2015 G. Giunta |
|
| 7 | + * |
|
| 8 | + * @todo !important allow user to specify location of docbook xslt instead of the one installed via composer |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | 11 | namespace PhpXmlRpc { |
| 12 | 12 | |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @author Gaetano Giunta |
|
| 4 | - * @copyright (C) 2005-2015 G. Giunta |
|
| 5 | - * @license code licensed under the BSD License: see file license.txt |
|
| 6 | - * |
|
| 7 | - * @todo switch params for http compression from 0,1,2 to values to be used directly |
|
| 8 | - * @todo use ob_start to catch debug info and echo it AFTER method call results? |
|
| 9 | - * @todo be smarter in creating client stub for proxy/auth cases: only set appropriate property of client obj |
|
| 10 | - **/ |
|
| 3 | + * @author Gaetano Giunta |
|
| 4 | + * @copyright (C) 2005-2015 G. Giunta |
|
| 5 | + * @license code licensed under the BSD License: see file license.txt |
|
| 6 | + * |
|
| 7 | + * @todo switch params for http compression from 0,1,2 to values to be used directly |
|
| 8 | + * @todo use ob_start to catch debug info and echo it AFTER method call results? |
|
| 9 | + * @todo be smarter in creating client stub for proxy/auth cases: only set appropriate property of client obj |
|
| 10 | + **/ |
|
| 11 | 11 | |
| 12 | 12 | header('Content-Type: text/html; charset=utf-8'); |
| 13 | 13 | |
@@ -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(); |
@@ -24,8 +24,9 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | if(strpos($method, 'test') === 0 && !in_array($method, $unsafeMethods)) |
| 26 | 26 | { |
| 27 | - if (!isset(self::$failed_tests[$method])) |
|
| 28 | - $this->$method(); |
|
| 27 | + if (!isset(self::$failed_tests[$method])) { |
|
| 28 | + $this->$method(); |
|
| 29 | + } |
|
| 29 | 30 | } |
| 30 | 31 | /*if ($this->_failed) |
| 31 | 32 | { |
@@ -76,9 +77,9 @@ discard block |
||
| 76 | 77 | { |
| 77 | 78 | $this->client->setProxy($this->args['PROXYSERVER'], $this->args['PROXYPORT']); |
| 78 | 79 | $this->_runtests(); |
| 80 | + } else { |
|
| 81 | + $this->markTestSkipped('PROXY definition missing: cannot test proxy'); |
|
| 79 | 82 | } |
| 80 | - else |
|
| 81 | - $this->markTestSkipped('PROXY definition missing: cannot test proxy'); |
|
| 82 | 83 | } |
| 83 | 84 | |
| 84 | 85 | function testHttp11() |
@@ -132,8 +133,7 @@ discard block |
||
| 132 | 133 | { |
| 133 | 134 | $this->markTestSkipped('CURL missing: cannot test http 1.1 w. proxy'); |
| 134 | 135 | return; |
| 135 | - } |
|
| 136 | - else if ($this->args['PROXYSERVER'] == '') |
|
| 136 | + } else if ($this->args['PROXYSERVER'] == '') |
|
| 137 | 137 | { |
| 138 | 138 | $this->markTestSkipped('PROXY definition missing: cannot test proxy w. http 1.1'); |
| 139 | 139 | return; |
@@ -170,8 +170,7 @@ discard block |
||
| 170 | 170 | { |
| 171 | 171 | $this->markTestSkipped('CURL missing: cannot test https functionality'); |
| 172 | 172 | return; |
| 173 | - } |
|
| 174 | - else if ($this->args['PROXYSERVER'] == '') |
|
| 173 | + } else if ($this->args['PROXYSERVER'] == '') |
|
| 175 | 174 | { |
| 176 | 175 | $this->markTestSkipped('PROXY definition missing: cannot test proxy w. http 1.1'); |
| 177 | 176 | return; |
@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Benchmarking suite for the PHP-XMLRPC lib. |
|
| 4 | - * |
|
| 5 | - * @author Gaetano Giunta |
|
| 6 | - * @copyright (c) 2005-2015 G. Giunta |
|
| 7 | - * @license code licensed under the BSD License: see file license.txt |
|
| 8 | - * |
|
| 9 | - * @todo add a test for response ok in call testing |
|
| 10 | - * @todo add support for --help option to give users the list of supported parameters |
|
| 11 | - **/ |
|
| 3 | + * Benchmarking suite for the PHP-XMLRPC lib. |
|
| 4 | + * |
|
| 5 | + * @author Gaetano Giunta |
|
| 6 | + * @copyright (c) 2005-2015 G. Giunta |
|
| 7 | + * @license code licensed under the BSD License: see file license.txt |
|
| 8 | + * |
|
| 9 | + * @todo add a test for response ok in call testing |
|
| 10 | + * @todo add support for --help option to give users the list of supported parameters |
|
| 11 | + **/ |
|
| 12 | 12 | |
| 13 | 13 | use PhpXmlRpc\PhpXmlRpc; |
| 14 | 14 | use PhpXmlRpc\Value; |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Used to serve back the server-side code coverage results to phpunit-selenium |
|
| 4 | - * |
|
| 5 | - * @copyright (C) 2007-2015 G. Giunta |
|
| 6 | - * @license code licensed under the BSD License: see file license.txt |
|
| 7 | - **/ |
|
| 3 | + * Used to serve back the server-side code coverage results to phpunit-selenium |
|
| 4 | + * |
|
| 5 | + * @copyright (C) 2007-2015 G. Giunta |
|
| 6 | + * @license code licensed under the BSD License: see file license.txt |
|
| 7 | + **/ |
|
| 8 | 8 | |
| 9 | 9 | $coverageFile = realpath(__DIR__ . "/../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/phpunit_coverage.php"); |
| 10 | 10 | |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * NB: do not let your IDE fool you. The correct encoding for this file is NOT UTF8. |
|
| 4 | - */ |
|
| 3 | + * NB: do not let your IDE fool you. The correct encoding for this file is NOT UTF8. |
|
| 4 | + */ |
|
| 5 | 5 | include_once __DIR__ . '/../lib/xmlrpc.inc'; |
| 6 | 6 | include_once __DIR__ . '/../lib/xmlrpcs.inc'; |
| 7 | 7 | |
@@ -17,14 +17,16 @@ |
||
| 17 | 17 | protected function setUp() |
| 18 | 18 | { |
| 19 | 19 | $this->args = argParser::getArgs(); |
| 20 | - if ($this->args['DEBUG'] == 1) |
|
| 21 | - ob_start(); |
|
| 20 | + if ($this->args['DEBUG'] == 1) { |
|
| 21 | + ob_start(); |
|
| 22 | + } |
|
| 22 | 23 | } |
| 23 | 24 | |
| 24 | 25 | protected function tearDown() |
| 25 | 26 | { |
| 26 | - if ($this->args['DEBUG'] != 1) |
|
| 27 | - return; |
|
| 27 | + if ($this->args['DEBUG'] != 1) { |
|
| 28 | + return; |
|
| 29 | + } |
|
| 28 | 30 | $out = ob_get_clean(); |
| 29 | 31 | $status = $this->getStatus(); |
| 30 | 32 | if ($status == PHPUnit_Runner_BaseTestRunner::STATUS_ERROR |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Demo server for xmlrpc library. |
|
| 4 | - * |
|
| 5 | - * Implements a lot of webservices, including a suite of services used for |
|
| 6 | - * interoperability testing (validator1 methods), and some whose only purpose |
|
| 7 | - * is to be used for unit-testing the library. |
|
| 8 | - * |
|
| 9 | - * Please do not copy this file verbatim into your production server. |
|
| 10 | - **/ |
|
| 3 | + * Demo server for xmlrpc library. |
|
| 4 | + * |
|
| 5 | + * Implements a lot of webservices, including a suite of services used for |
|
| 6 | + * interoperability testing (validator1 methods), and some whose only purpose |
|
| 7 | + * is to be used for unit-testing the library. |
|
| 8 | + * |
|
| 9 | + * Please do not copy this file verbatim into your production server. |
|
| 10 | + **/ |
|
| 11 | 11 | |
| 12 | 12 | // give user a chance to see the source for this server instead of running the services |
| 13 | 13 | if ($_SERVER['REQUEST_METHOD'] != 'POST' && isset($_GET['showSource'])) { |
@@ -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'; |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * XMLRPC server acting as proxy for requests to other servers |
|
| 4 | - * (useful e.g. for ajax-originated calls that can only connect back to |
|
| 5 | - * the originating server). |
|
| 6 | - * |
|
| 7 | - * @author Gaetano Giunta |
|
| 8 | - * @copyright (C) 2006-2015 G. Giunta |
|
| 9 | - * @license code licensed under the BSD License: see file license.txt |
|
| 10 | - */ |
|
| 3 | + * XMLRPC server acting as proxy for requests to other servers |
|
| 4 | + * (useful e.g. for ajax-originated calls that can only connect back to |
|
| 5 | + * the originating server). |
|
| 6 | + * |
|
| 7 | + * @author Gaetano Giunta |
|
| 8 | + * @copyright (C) 2006-2015 G. Giunta |
|
| 9 | + * @license code licensed under the BSD License: see file license.txt |
|
| 10 | + */ |
|
| 11 | 11 | |
| 12 | 12 | include_once __DIR__ . "/../../src/Autoloader.php"; |
| 13 | 13 | PhpXmlRpc\Autoloader::register(); |
@@ -457,9 +457,9 @@ discard block |
||
| 457 | 457 | * @return Response |
| 458 | 458 | */ |
| 459 | 459 | protected function sendPayloadHTTP10($req, $server, $port, $timeout = 0, |
| 460 | - $username = '', $password = '', $authType = 1, $proxyHost = '', |
|
| 461 | - $proxyPort = 0, $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, |
|
| 462 | - $method='http') |
|
| 460 | + $username = '', $password = '', $authType = 1, $proxyHost = '', |
|
| 461 | + $proxyPort = 0, $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, |
|
| 462 | + $method='http') |
|
| 463 | 463 | { |
| 464 | 464 | if ($port == 0) { |
| 465 | 465 | $port = ( $method === "https" ) ? 443 : 80; |
@@ -636,9 +636,9 @@ discard block |
||
| 636 | 636 | * @return Response |
| 637 | 637 | */ |
| 638 | 638 | protected function sendPayloadHTTPS($req, $server, $port, $timeout = 0, $username = '', |
| 639 | - $password = '', $authType = 1, $cert = '', $certPass = '', $caCert = '', $caCertDir = '', |
|
| 640 | - $proxyHost = '', $proxyPort = 0, $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, |
|
| 641 | - $keepAlive = false, $key = '', $keyPass = '', $sslVersion = 0) |
|
| 639 | + $password = '', $authType = 1, $cert = '', $certPass = '', $caCert = '', $caCertDir = '', |
|
| 640 | + $proxyHost = '', $proxyPort = 0, $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, |
|
| 641 | + $keepAlive = false, $key = '', $keyPass = '', $sslVersion = 0) |
|
| 642 | 642 | { |
| 643 | 643 | return $this->sendPayloadCURL($req, $server, $port, $timeout, $username, |
| 644 | 644 | $password, $authType, $cert, $certPass, $caCert, $caCertDir, $proxyHost, $proxyPort, |
@@ -674,9 +674,9 @@ discard block |
||
| 674 | 674 | * @return Response |
| 675 | 675 | */ |
| 676 | 676 | protected function sendPayloadCURL($req, $server, $port, $timeout = 0, $username = '', |
| 677 | - $password = '', $authType = 1, $cert = '', $certPass = '', $caCert = '', $caCertDir = '', |
|
| 678 | - $proxyHost = '', $proxyPort = 0, $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, $method = 'https', |
|
| 679 | - $keepAlive = false, $key = '', $keyPass = '', $sslVersion = 0) |
|
| 677 | + $password = '', $authType = 1, $cert = '', $certPass = '', $caCert = '', $caCertDir = '', |
|
| 678 | + $proxyHost = '', $proxyPort = 0, $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, $method = 'https', |
|
| 679 | + $keepAlive = false, $key = '', $keyPass = '', $sslVersion = 0) |
|
| 680 | 680 | { |
| 681 | 681 | if (!function_exists('curl_init')) { |
| 682 | 682 | $this->errstr = 'CURL unavailable on this install'; |