Move debugger to new api and add basic unit tests for it
[plcapi.git] / src / Server.php
index 1669e17..ccf6c8c 100644 (file)
@@ -160,7 +160,7 @@ class Server
             $out .= "<!-- SERVER DEBUG INFO (BASE64 ENCODED):\n" . base64_encode($this->debug_info) . "\n-->\n";
         }
         if (static::$_xmlrpc_debuginfo != '') {
-            $out .= "<!-- DEBUG INFO:\n" . Charset::instance()->encode_entities(str_replace('--', '_-', static::$_xmlrpc_debuginfo), PhpXmlRpc::$xmlrpc_internalencoding, $charset_encoding) . "\n-->\n";
+            $out .= "<!-- DEBUG INFO:\n" . Charset::instance()->encodeEntities(str_replace('--', '_-', static::$_xmlrpc_debuginfo), PhpXmlRpc::$xmlrpc_internalencoding, $charset_encoding) . "\n-->\n";
             // NB: a better solution MIGHT be to use CDATA, but we need to insert it
             // into return payload AFTER the beginning tag
             //$out .= "<![CDATA[ DEBUG INFO:\n\n" . str_replace(']]>', ']_]_>', static::$_xmlrpc_debuginfo) . "\n]]>\n";
@@ -180,7 +180,6 @@ class Server
     public function service($data = null, $return_payload = false)
     {
         if ($data === null) {
-            // workaround for a known bug in php ver. 5.2.2 that broke $HTTP_RAW_POST_DATA
             $data = file_get_contents('php://input');
         }
         $raw_data = $data;
@@ -289,7 +288,7 @@ class Server
     /**
      * Verify type and number of parameters received against a list of known signatures.
      *
-     * @param array $in array of either xmlrpcval objects or xmlrpc type definitions
+     * @param array $in array of either xmlrpc value objects or xmlrpc type definitions
      * @param array $sig array of known signatures to match against
      *
      * @return array
@@ -515,7 +514,7 @@ class Server
             xml_parser_free($parser);
             // small layering violation in favor of speed and memory usage:
             // we should allow the 'execute' method handle this, but in the
-            // most common scenario (xmlrpcvals type server with some methods
+            // most common scenario (xmlrpc values type server with some methods
             // registered as phpvals) that would mean a useless encode+decode pass
             if ($this->functions_parameters_type != 'xmlrpcvals' || (isset($this->dmap[$xmlRpcParser->_xh['method']]['parameters_type']) && ($this->dmap[$xmlRpcParser->_xh['method']]['parameters_type'] == 'phpvals'))) {
                 if ($this->debug > 1) {
@@ -700,16 +699,6 @@ class Server
         }
     }
 
-    /**
-     * A debugging routine: just echoes back the input packet as a string value
-     * DEPRECATED!
-     */
-    public function echoInput()
-    {
-        $r = new Response(new Value("'Aha said I: '" . file_get_contents('php://input'), 'string'));
-        print $r->serialize();
-    }
-
     /* Functions that implement system.XXX methods of xmlrpc servers */
 
     public function getSystemDispatchMap()
@@ -799,7 +788,7 @@ class Server
 
     public static function _xmlrpcs_methodSignature($server, $m)
     {
-        // let accept as parameter both an xmlrpcval or string
+        // let accept as parameter both an xmlrpc value or string
         if (is_object($m)) {
             $methName = $m->getParam(0);
             $methName = $methName->scalarval();
@@ -836,7 +825,7 @@ class Server
 
     public static function _xmlrpcs_methodHelp($server, $m)
     {
-        // let accept as parameter both an xmlrpcval or string
+        // let accept as parameter both an xmlrpc value or string
         if (is_object($m)) {
             $methName = $m->getParam(0);
             $methName = $methName->scalarval();