fix: allow epivals in mixed-calling-convention servers
[plcapi.git] / src / Request.php
index 2423510..655344c 100644 (file)
@@ -15,7 +15,9 @@ class Request
 {
     /// @todo: do these need to be public?
     public $payload;
+    /** @internal */
     public $methodname;
+    /** @internal */
     public $params = array();
     public $debug = 0;
     public $content_type = 'text/xml';
@@ -35,6 +37,11 @@ class Request
         }
     }
 
+    /**
+     * @internal this function will become protected in the future
+     * @param string $charsetEncoding
+     * @return string
+     */
     public function xml_header($charsetEncoding = '')
     {
         if ($charsetEncoding != '') {
@@ -44,11 +51,19 @@ class Request
         }
     }
 
+    /**
+     * @internal this function will become protected in the future
+     * @return string
+     */
     public function xml_footer()
     {
         return '</methodCall>';
     }
 
+    /**
+     * @internal this function will become protected in the future
+     * @param string $charsetEncoding
+     */
     public function createPayload($charsetEncoding = '')
     {
         if ($charsetEncoding != '') {
@@ -176,6 +191,8 @@ class Request
      *                           'phpvals'
      *
      * @return Response
+     *
+     * @todo parsing Responses is not really the responsibility of the Request class. Maybe of the Client...
      */
     public function parseResponse($data = '', $headersProcessed = false, $returnType = 'xmlrpcvals')
     {
@@ -186,7 +203,7 @@ class Request
         $this->httpResponse = array('raw_data' => $data, 'headers' => array(), 'cookies' => array());
 
         if ($data == '') {
-            error_log('XML-RPC: ' . __METHOD__ . ': no response received from server.');
+            Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': no response received from server.');
             return new Response(0, PhpXmlRpc::$xmlrpcerr['no_data'], PhpXmlRpc::$xmlrpcstr['no_data']);
         }
 
@@ -208,7 +225,7 @@ class Request
         // be tolerant of extra whitespace in response body
         $data = trim($data);
 
-        /// @todo return an error msg if $data=='' ?
+        /// @todo return an error msg if $data == '' ?
 
         // be tolerant of junk after methodResponse (e.g. javascript ads automatically inserted by free hosts)
         // idea from Luca Mariano <luca.mariano@email.it> originally in PEARified version of the lib
@@ -231,7 +248,7 @@ class Request
             }
         }
 
-        // if user wants back raw xml, give it to him
+        // if user wants back raw xml, give it to her
         if ($returnType == 'xml') {
             $r = new Response($data, 0, '', 'xml');
             $r->hdrs = $this->httpResponse['headers'];
@@ -254,7 +271,7 @@ class Request
                     if (extension_loaded('mbstring')) {
                         $data = mb_convert_encoding($data, 'UTF-8', $respEncoding);
                     } else {
-                        error_log('XML-RPC: ' . __METHOD__ . ': invalid charset encoding of received response: ' . $respEncoding);
+                        Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': invalid charset encoding of received response: ' . $respEncoding);
                     }
                 }
             }