Update comments
authorgggeek <giunta.gaetano@gmail.com>
Tue, 12 May 2015 22:56:03 +0000 (23:56 +0100)
committergggeek <giunta.gaetano@gmail.com>
Tue, 12 May 2015 22:56:03 +0000 (23:56 +0100)
demo/server/proxy.php
src/Wrapper.php

index 4f860de..adf8004 100644 (file)
@@ -15,6 +15,8 @@ PhpXmlRpc\Autoloader::register();
 /**
  * Forward an xmlrpc request to another server, and return to client the response received.
  *
+ * DO NOT RUN AS IS IN PRODUCTION - this is an open relay !!!
+ *
  * @param PhpXmlRpc\Request $req (see method docs below for a description of the expected parameters)
  *
  * @return PhpXmlRpc\Response
@@ -58,9 +60,9 @@ function forward_request($req)
     /// @todo find a way to forward client info (such as IP) to server, either
     /// - as xml comments in the payload, or
     /// - using std http header conventions, such as X-forwarded-for...
-    $reqethod = $encoder->decode($req->getParam(1));
+    $reqMethod = $encoder->decode($req->getParam(1));
     $pars = $req->getParam(2);
-    $req = new PhpXmlRpc\Request($reqethod);
+    $req = new PhpXmlRpc\Request($reqMethod);
     for ($i = 0; $i < $pars->arraySize(); $i++) {
         $req->addParam($pars->arraymem($i));
     }
index 48244fb..a870202 100644 (file)
@@ -338,8 +338,6 @@ class Wrapper
      * @param array $funcDesc as generated by self::introspectFunction()
      *
      * @return array
-     *
-     * @todo missing parameters
      */
     protected function buildMethodSignatures($funcDesc)
     {
@@ -396,7 +394,16 @@ class Wrapper
         );
     }
 
-    /// @todo use namespace, options to encode/decode objects, validate params
+    /**
+     * Creates a closure that will execute $callable
+     * @todo use namespace, options to encode/decode objects, validate params
+     *
+     * @param $callable
+     * @param array $extraOptions
+     * @param string $plainFuncName
+     * @param string $funcDesc
+     * @return callable
+     */
     protected function buildWrapFunctionClosure($callable, $extraOptions, $plainFuncName, $funcDesc)
     {
         $function = function($req) use($callable, $extraOptions)
@@ -569,7 +576,7 @@ class Wrapper
      * @return array or false on failure
      *
      * @todo get_class_methods will return both static and non-static methods.
-     *       we have to differentiate the action, depending on wheter we recived a class name or object
+     *       we have to differentiate the action, depending on whether we received a class name or object
      */
     public function wrap_php_class($classname, $extraOptions = array())
     {
@@ -822,7 +829,7 @@ class Wrapper
                     'encode_php_objs' => $encodePhpObjects, 'prefix' => $prefix,
                     'decode_php_objs' => $decodePhpObjects,
                 );
-                /// @todo build javadoc for class definition, too
+                /// @todo build phpdoc for class definition, too
                 foreach ($mlist as $mname) {
                     if ($methodfilter == '' || preg_match($methodfilter, $mname)) {
                         $opts['new_function_name'] = preg_replace(array('/\./', '/[^a-zA-Z0-9_\x7f-\xff]/'),