One more fix for issue #55 4.3.2
authorgggeek <giunta.gaetano@gmail.com>
Mon, 27 May 2019 08:04:00 +0000 (08:04 +0000)
committergggeek <giunta.gaetano@gmail.com>
Mon, 27 May 2019 08:04:00 +0000 (08:04 +0000)
NEWS
src/Client.php
src/Encoder.php
src/Helper/Charset.php
src/PhpXmlRpc.php
src/Request.php
src/Value.php

diff --git a/NEWS b/NEWS
index 6a788b5..fa06c12 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+XML-RPC for PHP version 4.3.2 - 2019/5/27
+
+* fixed: remove one php 7.2 warning when using the v3 compatibility layer
+
+* improved: the Travis tests are now run with all php versions from 5.6 to 7.3. We dropped tests with php 5.3, 5.4 and 5.5
+
+
 XML-RPC for PHP version 4.3.1 - 2018/1/20
 
 * fixed: error when using https in non-curl mode
index 8c782c3..074c196 100644 (file)
@@ -567,6 +567,8 @@ class Client
         $authType = 1, $proxyHost = '', $proxyPort = 0, $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1,
         $method='http')
     {
+        //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
+
         return $this->sendPayloadSocket($req, $server, $port, $timeout, $username, $password, $authType, null, null,
             null, null, $proxyHost, $proxyPort, $proxyUsername, $proxyPassword, $proxyAuthType, $method);
     }
@@ -600,6 +602,8 @@ class Client
         $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, $keepAlive = false, $key = '', $keyPass = '',
         $sslVersion = 0)
     {
+        //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
+
         return $this->sendPayloadCURL($req, $server, $port, $timeout, $username,
             $password, $authType, $cert, $certPass, $caCert, $caCertDir, $proxyHost, $proxyPort,
             $proxyUsername, $proxyPassword, $proxyAuthType, 'https', $keepAlive, $key, $keyPass, $sslVersion);
index b015115..ebf3060 100644 (file)
@@ -214,8 +214,7 @@ class Encoder
             // catch "user function", "unknown type"
             default:
                 // giancarlo pinerolo <ping@alt.it>
-                // it has to return
-                // an empty object in case, not a boolean.
+                // it has to return an empty object in case, not a boolean.
                 $xmlrpcVal = new Value();
                 break;
         }
@@ -227,6 +226,8 @@ class Encoder
      * Convert the xml representation of a method response, method request or single
      * xmlrpc value into the appropriate object (a.k.a. deserialize).
      *
+     * Q: is this a good name for this method? It does something quite different from 'decode' after all (returning objects vs returns plain php values)...
+     *
      * @param string $xmlVal
      * @param array $options
      *
@@ -291,7 +292,7 @@ class Encoder
         }
         switch ($xmlRpcParser->_xh['rt']) {
             case 'methodresponse':
-                $v = &$xmlRpcParser->_xh['value'];
+                $v = $xmlRpcParser->_xh['value'];
                 if ($xmlRpcParser->_xh['isf'] == 1) {
                     /** @var Value $vc */
                     $vc = $v['faultCode'];
index 4f1103b..f00087c 100644 (file)
@@ -261,6 +261,8 @@ class Charset
      */
     public function getEntities($charset)
     {
+        //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
+
         switch ($charset)
         {
             case 'iso88591':
index e9fb6e9..8b64d07 100644 (file)
@@ -79,7 +79,7 @@ class PhpXmlRpc
     public static $xmlrpc_internalencoding = "UTF-8";
 
     public static $xmlrpcName = "XML-RPC for PHP";
-    public static $xmlrpcVersion = "4.3.1";
+    public static $xmlrpcVersion = "4.3.2";
 
     // let user errors start at 800
     public static $xmlrpcerruser = 800;
index 9bd9029..b3b8112 100644 (file)
@@ -334,8 +334,7 @@ class Request
                 );
             }
 
-            // note that using =& will raise an error if $xmlRpcParser->_xh['st'] does not generate an object.
-            $v = &$xmlRpcParser->_xh['value'];
+            $v = $xmlRpcParser->_xh['value'];
 
             if ($xmlRpcParser->_xh['isf']) {
                 /// @todo we should test here if server sent an int and a string, and/or coerce them into such...
index ae73aaa..f51579b 100644 (file)
@@ -350,6 +350,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess
      */
     public function structmemexists($key)
     {
+        //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
+
         return array_key_exists($key, $this->me['struct']);
     }
 
@@ -365,6 +367,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess
      */
     public function structmem($key)
     {
+        //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
+
         return $this->me['struct'][$key];
     }
 
@@ -374,6 +378,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess
      */
     public function structreset()
     {
+        //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
+
         reset($this->me['struct']);
     }
 
@@ -386,7 +392,9 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess
      */
     public function structeach()
     {
-        return each($this->me['struct']);
+        //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
+
+        return @each($this->me['struct']);
     }
 
     /**
@@ -430,6 +438,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess
      */
     public function arraymem($key)
     {
+        //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
+
         return $this->me['array'][$key];
     }
 
@@ -442,6 +452,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess
      */
     public function arraysize()
     {
+        //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
+
         return count($this->me['array']);
     }
 
@@ -454,6 +466,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess
      */
     public function structsize()
     {
+        //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
+
         return count($this->me['struct']);
     }