Fix leftovers from branch merging; remove more php closing tags; bump up requirements...
authorgggeek <giunta.gaetano@gmail.com>
Wed, 10 Dec 2014 00:01:55 +0000 (00:01 +0000)
committergggeek <giunta.gaetano@gmail.com>
Wed, 10 Dec 2014 00:01:55 +0000 (00:01 +0000)
12 files changed:
.travis.yml
ChangeLog
Makefile
NEWS
composer.json
demo/client/simple_call.php
demo/client/which.php
demo/server/server.php
doc/xmlrpc_php.xml
lib/phpxmlrpc.php
lib/xmlrpc_wrappers.php
test/parse_args.php

index ca59cd0..a40322b 100644 (file)
@@ -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...
index 4306b5e..e032f79 100644 (file)
--- 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)
index 28a83b0..4b4e4ef 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -21,8 +21,7 @@ DOS2UNIX=dos2unix
 # recover version number from code\r
 # thanks to Firman Pribadi for unix command line help\r
 #   on unix shells lasts char should be \\2/g )\r
-###export VERSION=$(shell grep -E "\$GLOBALS *\[ *'xmlrpcVersion' *\] *= *'" lib/xmlrpc.inc | sed -r s/"(.*= *' *)([0-9a-zA-Z.-]+)(.*)"/\2/g )\r
-export VERSION=3.0.0\r
+export VERSION=$(shell grep -E "\$GLOBALS *\[ *'xmlrpcVersion' *\] *= *'" lib/xmlrpc.inc | sed -r s/"(.*= *' *)([0-9a-zA-Z.-]+)(.*)"/\2/g )\r
 \r
 LIBFILES=lib/xmlrpc.inc lib/xmlrpcs.inc lib/xmlrpc_wrappers.inc\r
 \r
diff --git a/NEWS b/NEWS
index 5d36f47..62b43ee 100644 (file)
--- 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
index 20c31ec..294d5c6 100644 (file)
@@ -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
index 6f907d5..9764b7f 100644 (file)
@@ -55,4 +55,3 @@
             return $client->send(new xmlrpcmsg($remote_function_name, $xmlrpcval_array));
         }
     }
-?>
index 49337dc..8b1ba48 100644 (file)
@@ -1,5 +1 @@
-<<<<<<< HEAD
-<html>\r\r<head><title>xmlrpc</title></head>\r\r<body>\r\r<h1>Which toolkit demo</h1>\r\r<h2>Query server for toolkit information</h2>\r\r<h3>The code demonstrates usage of the php_xmlrpc_decode function</h3>\r\r<?php\r\r        include("xmlrpc.inc");\r\r\r\r      $f = new xmlrpcmsg('interopEchoTests.whichToolkit', array());\r\r $c = new xmlrpc_client("/server.php", "phpxmlrpc.sourceforge.net", 80);\r\r       $r = $c->send($f);\r\r    if(!$r->faultCode())\r\r  {\r\r             $v = php_xmlrpc_decode($r->value());\r\r          print "<pre>";\r\r                print "name: " . htmlspecialchars($v["toolkitName"]) . "\n";\r\r          print "version: " . htmlspecialchars($v["toolkitVersion"]) . "\n";\r\r            print "docs: " . htmlspecialchars($v["toolkitDocsUrl"]) . "\n";\r\r               print "os: " . htmlspecialchars($v["toolkitOperatingSystem"]) . "\n";\r\r         print "</pre>";\r\r       }\r\r     else\r\r  {\r\r             print "An error occurred: ";\r\r          print "Code: " . htmlspecialchars($r->faultCode()) . " Reason: '" . htmlspecialchars($r->faultString()) . "'\n";\r\r      }\r\r?>\r\r</body>\r\r</html>\r\r
-=======
-<html>\r\r<head><title>xmlrpc</title></head>\r\r<body>\r\r<h1>Which toolkit demo</h1>\r\r<h2>Query server for toolkit information</h2>\r\r<h3>The code demonstrates usage of the php_xmlrpc_decode function</h3>\r\r<?php\r\rinclude("xmlrpc.inc");\r\r\r\r    $f = new xmlrpcmsg('interopEchoTests.whichToolkit', array());\r\r    $c = new xmlrpc_client("/server.php", "phpxmlrpc.sourceforge.net", 80);\r\r    $r = $c->send($f);\r\r    if(!$r->faultCode())\r\r    {\r\r        $v = php_xmlrpc_decode($r->value());\r\r        print "<pre>";\r\r        print "name: " . htmlspecialchars($v["toolkitName"]) . "\n";\r\r        print "version: " . htmlspecialchars($v["toolkitVersion"]) . "\n";\r\r        print "docs: " . htmlspecialchars($v["toolkitDocsUrl"]) . "\n";\r\r        print "os: " . htmlspecialchars($v["toolkitOperatingSystem"]) . "\n";\r\r        print "</pre>";\r\r    }\r\r    else\r\r    {\r\r        print "An error occurred: ";\r\r        print "Code: " . htmlspecialchars($r->faultCode()) . " Reason: '" . htmlspecialchars($r->faultString()) . "'\n";\r\r    }\r\r?>\r\r<hr/>\r\r<em>$Id$</em>\r\r</body>\r\r</html>\r\r
->>>>>>> php53
+<html>\r\r<head><title>xmlrpc</title></head>\r\r<body>\r\r<h1>Which toolkit demo</h1>\r\r<h2>Query server for toolkit information</h2>\r\r<h3>The code demonstrates usage of the php_xmlrpc_decode function</h3>\r\r<?php\r\r        include("xmlrpc.inc");\r\r\r\r      $f = new xmlrpcmsg('interopEchoTests.whichToolkit', array());\r\r $c = new xmlrpc_client("/server.php", "phpxmlrpc.sourceforge.net", 80);\r\r       $r = $c->send($f);\r\r    if(!$r->faultCode())\r\r  {\r\r             $v = php_xmlrpc_decode($r->value());\r\r          print "<pre>";\r\r                print "name: " . htmlspecialchars($v["toolkitName"]) . "\n";\r\r          print "version: " . htmlspecialchars($v["toolkitVersion"]) . "\n";\r\r            print "docs: " . htmlspecialchars($v["toolkitDocsUrl"]) . "\n";\r\r               print "os: " . htmlspecialchars($v["toolkitOperatingSystem"]) . "\n";\r\r         print "</pre>";\r\r       }\r\r     else\r\r  {\r\r             print "An error occurred: ";\r\r          print "Code: " . htmlspecialchars($r->faultCode()) . " Reason: '" . htmlspecialchars($r->faultString()) . "'\n";\r\r      }\r\r?>\r\r</body>\r\r</html>\r\r
\ No newline at end of file
index f44c2c7..853dc4b 100644 (file)
@@ -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()));
     }
 
index d395f5f..e6c927f 100644 (file)
@@ -12,6 +12,7 @@ PHP-XMLRPC User manual
 
   <bookinfo>
     <date>June 15, 2014</date>
+
     <authorgroup>
       <author>
         <firstname>Edd</firstname>
@@ -238,7 +239,8 @@ PHP-XMLRPC User manual
       </itemizedlist></para>
     </sect1>
 
-    <sect1>      <title>3.0.0 beta</title>
+    <sect1>
+      <title>3.0.0 beta</title>
 
       <para>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
index 8fa6684..0113391 100644 (file)
@@ -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;
index e96be5e..6db92f0 100644 (file)
@@ -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\r
 * that will call it and return results using native php types for both\r
 * params and results. The generated php function will return an xmlrpcresp\r
-* oject for failed xmlrpc calls\r
+* object for failed xmlrpc calls\r
 *\r
 * Known limitations:\r
 * - server must support system.methodsignature for the wanted xmlrpc method\r
 * - for methods that expose many signatures, only one can be picked (we\r
-*   could in priciple check if signatures differ only by number of params\r
+*   could in principle check if signatures differ only by number of params\r
 *   and not by type, but it would be more complication than we can spare time)\r
 * - nested xmlrpc params: the caller of the generated php function has to\r
 *   encode on its own the params passed to the php function if these are structs\r
@@ -536,11 +536,11 @@ function wrap_php_class($classname, $extra_options=array())
 *\r
 * @param xmlrpc_client $client     an xmlrpc client set up correctly to communicate with target server\r
 * @param string        $methodname the xmlrpc method to be mapped to a php function\r
-* @param array         $extra_options array of options that specify conversion details. valid ptions include\r
+* @param array         $extra_options array of options that specify conversion details. valid options include\r
 *        integer       signum      the index of the method signature to use in mapping (if method exposes many sigs)\r
 *        integer       timeout     timeout (in secs) to be used when executing function/calling remote method\r
 *        string        protocol    'http' (default), 'http11' or 'https'\r
-*        string        new_function_name the name of php function to create. If unsepcified, lib will pick an appropriate name\r
+*        string        new_function_name the name of php function to create. If unspecified, lib will pick an appropriate name\r
 *        string        return_source if true return php code w. function definition instead fo function name\r
 *        bool          encode_php_objs let php objects be sent to server using the 'improved' xmlrpc notation, so server can deserialize them as php objects\r
 *        bool          decode_php_objs --- WARNING !!! possible security hazard. only use it with trusted servers ---\r
@@ -570,6 +570,7 @@ function wrap_xmlrpc_method($client, $methodname, $extra_options=0, $timeout=0,
 \r
     $encode_php_objects = isset($extra_options['encode_php_objs']) ? (bool)$extra_options['encode_php_objs'] : false;\r
     $decode_php_objects = isset($extra_options['decode_php_objs']) ? (bool)$extra_options['decode_php_objs'] : false;\r
+    // it seems like the meaning of 'simple_client_copy' here is swapped wrt client_copy_mode later on...\r
     $simple_client_copy = isset($extra_options['simple_client_copy']) ? (int)($extra_options['simple_client_copy']) : 0;\r
     $buildit = isset($extra_options['return_source']) ? !($extra_options['return_source']) : true;\r
     $prefix = isset($extra_options['prefix']) ? $extra_options['prefix'] : 'xmlrpc';\r
index 60e777f..418b18c 100644 (file)
             $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