comments
authorgggeek <giunta.gaetano@gmail.com>
Tue, 17 Jan 2023 13:11:38 +0000 (13:11 +0000)
committergggeek <giunta.gaetano@gmail.com>
Tue, 17 Jan 2023 13:11:38 +0000 (13:11 +0000)
src/Client.php
src/Encoder.php
src/Helper/XMLParser.php
src/Request.php
src/Server.php
src/Value.php
src/Wrapper.php

index f4128d4..bfeefe2 100644 (file)
@@ -487,7 +487,7 @@ class Client
     /**
      * Directly set cURL options, for extra flexibility (when in cURL mode).
      *
-     * It allows eg. to bind client to a specific IP interface / address.
+     * It allows e.g. to bind client to a specific IP interface / address.
      *
      * @param array $options
      * @return $this
@@ -781,7 +781,7 @@ class Client
         if ($username != '') {
             $credentials = 'Authorization: Basic ' . base64_encode($username . ':' . $password) . "\r\n";
             if ($authType != 1) {
-                /// @todo make this a proper error, ie. return a failure
+                /// @todo make this a proper error, i.e. return a failure
                 $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported with HTTP 1.0');
             }
         }
@@ -803,7 +803,7 @@ class Client
             $uri = 'http://' . $server . ':' . $port . $this->path;
             if ($proxyUsername != '') {
                 if ($proxyAuthType != 1) {
-                    /// @todo make this a proper error, ie. return a failure
+                    /// @todo make this a proper error, i.e. return a failure
                     $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported with HTTP 1.0');
                 }
                 $proxyCredentials = 'Proxy-Authorization: Basic ' . base64_encode($proxyUsername . ':' . $proxyPassword) . "\r\n";
@@ -1162,7 +1162,7 @@ class Client
                 if (defined('CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE')) {
                     curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE);
                 } else {
-                    /// @todo make this a proper error, ie. return a failure
+                    /// @todo make this a proper error, i.e. return a failure
                     $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': warning. HTTP2 is not supported by the current PHP/curl install');
                 }
                 break;
@@ -1176,7 +1176,7 @@ class Client
             if (defined('CURLOPT_HTTPAUTH')) {
                 curl_setopt($curl, CURLOPT_HTTPAUTH, $authType);
             } elseif ($authType != 1) {
-                /// @todo make this a proper error, ie. return a failure
+                /// @todo make this a proper error, i.e. return a failure
                 $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported by the current PHP/curl install');
             }
         }
@@ -1226,7 +1226,7 @@ class Client
                 if (defined('CURLOPT_PROXYAUTH')) {
                     curl_setopt($curl, CURLOPT_PROXYAUTH, $proxyAuthType);
                 } elseif ($proxyAuthType != 1) {
-                    /// @todo make this a proper error, ie. return a failure
+                    /// @todo make this a proper error, i.e. return a failure
                     $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported by the current PHP/curl install');
                 }
             }
index bd5bac3..b3a9cb9 100644 (file)
@@ -203,7 +203,7 @@ class Encoder
         $type = gettype($phpVal);
         switch ($type) {
             case 'string':
-                /// @todo should we be stricter in the accepted dates (ie. reject more of invalid days & times)?
+                /// @todo should we be stricter in the accepted dates (i.e. reject more of invalid days & times)?
                 if (in_array('auto_dates', $options) && preg_match('/^[0-9]{8}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/', $phpVal)) {
                     $xmlrpcVal = new Value($phpVal, Value::$xmlrpcDateTime);
                 } else {
@@ -340,7 +340,8 @@ class Encoder
             }
         }
 
-        // What if internal encoding is not in one of the 3 allowed? We use the broadest one, ie. utf8!
+        // What if internal encoding is not in one of the 3 allowed? We use the broadest one, i.e. utf8!
+        /// @todo with php < 5.6, this does not work. We should add a manual conversion of the xml string to UTF8
         if (in_array(PhpXmlRpc::$xmlrpc_internalencoding, array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) {
             $parserOptions = array(XML_OPTION_TARGET_ENCODING => PhpXmlRpc::$xmlrpc_internalencoding);
         } else {
index dd21736..7699f62 100644 (file)
@@ -133,7 +133,7 @@ class XMLParser
      * @param array $options integer-key options are passed to the xml parser, in addition to the options received in
      *                       the constructor. String-key options are used independently
      * @return void the caller has to look into $this->_xh to find the results
-     * @throws \Exception this can happen if a callback function is set and it does throw (ie. we do not catch exceptions)
+     * @throws \Exception this can happen if a callback function is set and it does throw (i.e. we do not catch exceptions)
      */
     public function parse($data, $returnType = self::RETURN_XMLRPCVALS, $accept = 3, $options = array())
     {
@@ -466,7 +466,7 @@ class XMLParser
      * @param string $name
      * @param int $rebuildXmlrpcvals >1 for rebuilding xmlrpcvals, 0 for rebuilding php values, -1 for xmlrpc-extension compatibility
      * @return void
-     * @throws \Exception this can happen if a callback function is set and it does throw (ie. we do not catch exceptions)
+     * @throws \Exception this can happen if a callback function is set and it does throw (i.e. we do not catch exceptions)
      */
     public function xmlrpc_ee($parser, $name, $rebuildXmlrpcvals = 1)
     {
@@ -553,9 +553,9 @@ class XMLParser
                     $this->_xh['value'] = base64_decode($this->_xh['ac']);
                 } elseif ($name == 'BOOLEAN') {
                     // special case here: we translate boolean 1 or 0 into PHP constants true or false.
-                    // Strings 'true' and 'false' are accepted, even though the spec never mentions them (see eg.
+                    // Strings 'true' and 'false' are accepted, even though the spec never mentions them (see e.g.
                     // Blogger api docs)
-                    // NB: this simple checks helps a lot sanitizing input, ie. no security problems around here
+                    // NB: this simple checks helps a lot sanitizing input, i.e. no security problems around here
                     if ($this->_xh['ac'] == '1' || strcasecmp($this->_xh['ac'], 'true') == 0) {
                         $this->_xh['value'] = true;
                     } else {
@@ -713,7 +713,7 @@ class XMLParser
     }
 
     /**
-     * xml parser handler function for 'other stuff', ie. not char data or element start/end tag.
+     * xml parser handler function for 'other stuff', i.e. not char data or element start/end tag.
      * In fact it only gets called on unknown entities...
      * @internal
      *
index c82bc12..dce5aae 100644 (file)
@@ -334,7 +334,7 @@ class Request
             }
         }
         // PHP internally might use ISO-8859-1, so we have to tell the xml parser to give us back data in the expected charset.
-        // What if internal encoding is not in one of the 3 allowed? We use the broadest one, ie. utf8
+        // What if internal encoding is not in one of the 3 allowed? We use the broadest one, i.e. utf8
         if (in_array(PhpXmlRpc::$xmlrpc_internalencoding, array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) {
             $options = array(XML_OPTION_TARGET_ENCODING => PhpXmlRpc::$xmlrpc_internalencoding);
         } else {
index 6beca1a..ed65441 100644 (file)
@@ -605,7 +605,7 @@ class Server
             }
         }
         // PHP internally might use ISO-8859-1, so we have to tell the xml parser to give us back data in the expected charset.
-        // What if internal encoding is not in one of the 3 allowed? We use the broadest one, ie. utf8
+        // What if internal encoding is not in one of the 3 allowed? We use the broadest one, i.e. utf8
         if (in_array(PhpXmlRpc::$xmlrpc_internalencoding, array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) {
             $options = array(XML_OPTION_TARGET_ENCODING => PhpXmlRpc::$xmlrpc_internalencoding);
         } else {
index 63f7022..8aebe35 100644 (file)
@@ -303,7 +303,7 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess
                     case static::$xmlrpcDouble:
                         // avoid using standard conversion of float to string because it is locale-dependent,
                         // and also because the xmlrpc spec forbids exponential notation.
-                        // sprintf('%F') could be most likely ok, but it fails eg. on 2e-14.
+                        // sprintf('%F') could be most likely ok, but it fails e.g. on 2e-14.
                         // The code below tries its best at keeping max precision while avoiding exp notation,
                         // but there is of course no limit in the number of decimal places to be used...
                         $rs .= "<{$typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, PhpXmlRpc::$xmlpc_double_precision, '.', '')) . "</{$typ}>";
index 36aa7b2..71d878f 100644 (file)
@@ -151,7 +151,7 @@ class Wrapper
      *   Other libs might choke on the very same xml that will be generated in this case (i.e. it has a nonstandard
      *   attribute on struct element tags)
      *
-     * Note that since rel. 2.0RC3 the preferred method to have the server call 'standard' php functions (ie. functions
+     * Note that since rel. 2.0RC3 the preferred method to have the server call 'standard' php functions (i.e. functions
      * not expecting a single Request obj as parameter) is by making use of the $functions_parameters_type and
      * $exception_handling properties.
      *