From: gggeek <giunta.gaetano@gmail.com>
Date: Sat, 30 May 2015 12:49:59 +0000 (+0200)
Subject: Fix: debugger was not able any more to generate wrapped client code
X-Git-Tag: 4.0.0-alpha^2~24
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c325fab48f8f3eabc35123efdf5916b77cc878e2;p=plcapi.git

Fix: debugger was not able any more to generate wrapped client code
---

diff --git a/debugger/action.php b/debugger/action.php
index 0e6ee450..2e128861 100644
--- a/debugger/action.php
+++ b/debugger/action.php
@@ -481,9 +481,9 @@ if ($action) {
                         if ($proxy == '' && $username == '' && !$requestcompression && !$responsecompression &&
                             $clientcookies == ''
                         ) {
-                            $opts = 0; // simple client copy in stub code
+                            $opts = 1; // simple client copy in stub code
                         } else {
-                            $opts = 1; // complete client copy in stub code
+                            $opts = 0; // complete client copy in stub code
                         }
                         if ($wstype == 1) {
                             $prefix = 'jsonrpc';
@@ -492,7 +492,7 @@ if ($action) {
                         }
                         //$code = wrap_xmlrpc_method($client, $method, $methodsig, 0, $proto, '', $opts);
                         $wrapper = new PhpXmlRpc\Wrapper();
-                        $code = $wrapper->build_remote_method_wrapper_code($client, $method, str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc, $timeout, $proto, $opts, $prefix);
+                        $code = $wrapper->buildWrapMethodSource($client, $method, array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix), str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc);
                         //if ($code)
                         //{
                         echo "<div id=\"phpcode\">\n";
diff --git a/src/Wrapper.php b/src/Wrapper.php
index f7f20721..c3d1514d 100644
--- a/src/Wrapper.php
+++ b/src/Wrapper.php
@@ -882,7 +882,7 @@ class Wrapper
      * @param string $mDesc
      * @return array
      */
-    protected function buildWrapMethodSource($client, $methodName, array $extraOptions, $newFuncName, $mSig, $mDesc='')
+    public function buildWrapMethodSource($client, $methodName, array $extraOptions, $newFuncName, $mSig, $mDesc='')
     {
         $timeout = isset($extraOptions['timeout']) ? (int)$extraOptions['timeout'] : 0;
         $protocol = isset($extraOptions['protocol']) ? $extraOptions['protocol'] : '';