From: gggeek Date: Wed, 10 Dec 2014 00:01:55 +0000 (+0000) Subject: Fix leftovers from branch merging; remove more php closing tags; bump up requirements... X-Git-Tag: 4.0.0-alpha^2~211 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=fc11f8b24caff6db782867a0061f70a1e35ef5ca;p=plcapi.git Fix leftovers from branch merging; remove more php closing tags; bump up requirements to 5.3; fix composer autoloading; do not test on 5.2 on travis --- diff --git a/.travis.yml b/.travis.yml index ca59cd00..a40322be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: php php: - - 5.2 - 5.3 - 5.4 - 5.5 @@ -9,8 +8,7 @@ php: - hhvm install: - # NB: the lib does not declare dependencies for now. Also, composer will not run on php 5.2 - - if [ $TRAVIS_PHP_VERSION != "5.2" ]; then composer self-update && composer install; fi + - composer self-update && composer install before_script: # Disable xdebug. NB: this should NOT be done for hhvm... diff --git a/ChangeLog b/ChangeLog index 4306b5e4..e032f791 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,7 +4,7 @@ See https://github.com/gggeek/phpxmlrpc/commits/master 2014-05-26 - G. Giunta (giunta.gaetano@gmail.com) - * removed bundled php unit + * removed bundled phpunit * converted all tabs to spaces in php files and removed closing tags 2014-05-12 - Samu Voutilainen (smar@smar.fi) diff --git a/Makefile b/Makefile index 28a83b0e..4b4e4efa 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,7 @@ DOS2UNIX=dos2unix # recover version number from code # thanks to Firman Pribadi for unix command line help # on unix shells lasts char should be \\2/g ) -###export VERSION=$(shell grep -E "\$GLOBALS *\[ *'xmlrpcVersion' *\] *= *'" lib/xmlrpc.inc | sed -r s/"(.*= *' *)([0-9a-zA-Z.-]+)(.*)"/\2/g ) -export VERSION=3.0.0 +export VERSION=$(shell grep -E "\$GLOBALS *\[ *'xmlrpcVersion' *\] *= *'" lib/xmlrpc.inc | sed -r s/"(.*= *' *)([0-9a-zA-Z.-]+)(.*)"/\2/g ) LIBFILES=lib/xmlrpc.inc lib/xmlrpcs.inc lib/xmlrpc_wrappers.inc diff --git a/NEWS b/NEWS index 5d36f479..62b43ee0 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,20 @@ -XML-RPC for PHP version 3.0.1 - 201X/Y/Z +XML-RPC for PHP version 4.0.0 - 201X/Y/Z -Taking baby steps to modern-world php, this release is now tested using Travis ( https://travis-ci.org/ ). +This release does away with the past and starts a transition to modern-world php. -Improved: no need to call anymore $client->setSSLVerifyHost(2) to silence a curl warning when using https with recent curl builds +Code has been heavily refactored, taking care to preserve backwards compatibility as much as possible, +but some breackage is to be expected. + +PLEASE READ CAREFULLY THE NOTES BELOW to insure a smooth upgrade. + +The minimum requied php version has been increase to 5.3, +even though we stronly urge you to use more recent versions. + +* improved: this release is now tested using Travis ( https://travis-ci.org/ ). + +* improved: no need to call anymore $client->setSSLVerifyHost(2) to silence a curl warning when using https with recent curl builds + +* improved: phpunit is now installed via composer, not bundled anymore XML-RPC for PHP version 3.0.0 - 2014/6/15 diff --git a/composer.json b/composer.json index 20c31ec6..294d5c67 100644 --- a/composer.json +++ b/composer.json @@ -5,9 +5,12 @@ "homepage": "http://gggeek.github.io/phpxmlrpc/", "keywords": [ "xmlrpc", "webservices" ], "require": { - "php": ">=5.1.0" + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "4.3.*" }, "autoload": { - "classmap": [ "lib/xmlrpc.inc", "lib/xmlrpcs.inc" ] + "classmap": [ "lib/" ] } } \ No newline at end of file diff --git a/demo/client/simple_call.php b/demo/client/simple_call.php index 6f907d5c..9764b7fa 100644 --- a/demo/client/simple_call.php +++ b/demo/client/simple_call.php @@ -55,4 +55,3 @@ return $client->send(new xmlrpcmsg($remote_function_name, $xmlrpcval_array)); } } -?> diff --git a/demo/client/which.php b/demo/client/which.php index 49337dcc..8b1ba488 100644 --- a/demo/client/which.php +++ b/demo/client/which.php @@ -1,5 +1 @@ -<<<<<<< HEAD - xmlrpc

Which toolkit demo

Query server for toolkit information

The code demonstrates usage of the php_xmlrpc_decode function

send($f); if(!$r->faultCode()) { $v = php_xmlrpc_decode($r->value()); print "
";

		print "name: " . htmlspecialchars($v["toolkitName"]) . "\n";

		print "version: " . htmlspecialchars($v["toolkitVersion"]) . "\n";

		print "docs: " . htmlspecialchars($v["toolkitDocsUrl"]) . "\n";

		print "os: " . htmlspecialchars($v["toolkitOperatingSystem"]) . "\n";

		print "
"; } else { print "An error occurred: "; print "Code: " . htmlspecialchars($r->faultCode()) . " Reason: '" . htmlspecialchars($r->faultString()) . "'\n"; } ?> -======= - xmlrpc

Which toolkit demo

Query server for toolkit information

The code demonstrates usage of the php_xmlrpc_decode function

send($f); if(!$r->faultCode()) { $v = php_xmlrpc_decode($r->value()); print "
";

        print "name: " . htmlspecialchars($v["toolkitName"]) . "\n";

        print "version: " . htmlspecialchars($v["toolkitVersion"]) . "\n";

        print "docs: " . htmlspecialchars($v["toolkitDocsUrl"]) . "\n";

        print "os: " . htmlspecialchars($v["toolkitOperatingSystem"]) . "\n";

        print "
"; } else { print "An error occurred: "; print "Code: " . htmlspecialchars($r->faultCode()) . " Reason: '" . htmlspecialchars($r->faultString()) . "'\n"; } ?>
$Id$ ->>>>>>> php53 + xmlrpc

Which toolkit demo

Query server for toolkit information

The code demonstrates usage of the php_xmlrpc_decode function

send($f); if(!$r->faultCode()) { $v = php_xmlrpc_decode($r->value()); print "
";

		print "name: " . htmlspecialchars($v["toolkitName"]) . "\n";

		print "version: " . htmlspecialchars($v["toolkitVersion"]) . "\n";

		print "docs: " . htmlspecialchars($v["toolkitDocsUrl"]) . "\n";

		print "os: " . htmlspecialchars($v["toolkitOperatingSystem"]) . "\n";

		print "
"; } else { print "An error occurred: "; print "Code: " . htmlspecialchars($r->faultCode()) . " Reason: '" . htmlspecialchars($r->faultString()) . "'\n"; } ?> \ No newline at end of file diff --git a/demo/server/server.php b/demo/server/server.php index f44c2c79..853dc4b6 100644 --- a/demo/server/server.php +++ b/demo/server/server.php @@ -166,7 +166,6 @@ in an alphabetic order.'; // just sends back a string $s=$m->getParam(0); $v = $s->scalarval(); -file_put_contents('D:/temp/zozzo.log', $v, FILE_APPEND); return new xmlrpcresp(new xmlrpcval($s->scalarval())); } diff --git a/doc/xmlrpc_php.xml b/doc/xmlrpc_php.xml index d395f5f4..e6c927fa 100644 --- a/doc/xmlrpc_php.xml +++ b/doc/xmlrpc_php.xml @@ -12,6 +12,7 @@ PHP-XMLRPC User manual June 15, 2014 + Edd @@ -238,7 +239,8 @@ PHP-XMLRPC User manual - 3.0.0 beta + + 3.0.0 beta This is the first release of the library to only support PHP 5. Some legacy code has been removed, and support for features such as diff --git a/lib/phpxmlrpc.php b/lib/phpxmlrpc.php index 8fa6684a..01133914 100644 --- a/lib/phpxmlrpc.php +++ b/lib/phpxmlrpc.php @@ -123,7 +123,7 @@ class Phpxmlrpc public $xmlrpc_internalencoding = "ISO-8859-1"; // TODO: maybe this would be better as UTF-8, or atleast configurable? public $xmlrpcName = "XML-RPC for PHP"; - public $xmlrpcVersion = "3.0.0.beta"; + public $xmlrpcVersion = "4.0.0.beta"; // let user errors start at 800 public $xmlrpcerruser = 800; diff --git a/lib/xmlrpc_wrappers.php b/lib/xmlrpc_wrappers.php index e96be5e5..6db92f06 100644 --- a/lib/xmlrpc_wrappers.php +++ b/lib/xmlrpc_wrappers.php @@ -515,12 +515,12 @@ function wrap_php_class($classname, $extra_options=array()) * Given an xmlrpc client and a method name, register a php wrapper function * that will call it and return results using native php types for both * params and results. The generated php function will return an xmlrpcresp -* oject for failed xmlrpc calls +* object for failed xmlrpc calls * * Known limitations: * - server must support system.methodsignature for the wanted xmlrpc method * - for methods that expose many signatures, only one can be picked (we -* could in priciple check if signatures differ only by number of params +* could in principle check if signatures differ only by number of params * and not by type, but it would be more complication than we can spare time) * - nested xmlrpc params: the caller of the generated php function has to * encode on its own the params passed to the php function if these are structs @@ -536,11 +536,11 @@ function wrap_php_class($classname, $extra_options=array()) * * @param xmlrpc_client $client an xmlrpc client set up correctly to communicate with target server * @param string $methodname the xmlrpc method to be mapped to a php function -* @param array $extra_options array of options that specify conversion details. valid ptions include +* @param array $extra_options array of options that specify conversion details. valid options include * integer signum the index of the method signature to use in mapping (if method exposes many sigs) * integer timeout timeout (in secs) to be used when executing function/calling remote method * string protocol 'http' (default), 'http11' or 'https' -* string new_function_name the name of php function to create. If unsepcified, lib will pick an appropriate name +* string new_function_name the name of php function to create. If unspecified, lib will pick an appropriate name * string return_source if true return php code w. function definition instead fo function name * bool encode_php_objs let php objects be sent to server using the 'improved' xmlrpc notation, so server can deserialize them as php objects * bool decode_php_objs --- WARNING !!! possible security hazard. only use it with trusted servers --- @@ -570,6 +570,7 @@ function wrap_xmlrpc_method($client, $methodname, $extra_options=0, $timeout=0, $encode_php_objects = isset($extra_options['encode_php_objs']) ? (bool)$extra_options['encode_php_objs'] : false; $decode_php_objects = isset($extra_options['decode_php_objs']) ? (bool)$extra_options['decode_php_objs'] : false; + // it seems like the meaning of 'simple_client_copy' here is swapped wrt client_copy_mode later on... $simple_client_copy = isset($extra_options['simple_client_copy']) ? (int)($extra_options['simple_client_copy']) : 0; $buildit = isset($extra_options['return_source']) ? !($extra_options['return_source']) : true; $prefix = isset($extra_options['prefix']) ? $extra_options['prefix'] : 'xmlrpc'; diff --git a/test/parse_args.php b/test/parse_args.php index 60e777fc..418b18c7 100644 --- a/test/parse_args.php +++ b/test/parse_args.php @@ -100,6 +100,11 @@ $PROXYPORT = 8080; } } + // used to silence testsuite warnings about proxy code not being tested + if(!isset($NOPROXY)) + { + $NOPROXY = false; + } if(!isset($URI)) { // GUESTIMATE the url of local demo server