take into account new locations for the debuggers visualeditor, to accommodate jsonrpc
authorgggeek <giunta.gaetano@gmail.com>
Thu, 19 Jan 2023 21:36:45 +0000 (21:36 +0000)
committergggeek <giunta.gaetano@gmail.com>
Thu, 19 Jan 2023 21:36:45 +0000 (21:36 +0000)
debugger/controller.php
demo/server/proxy.php

index bcc759f..7d8ca11 100644 (file)
@@ -36,13 +36,16 @@ if (defined('JSXMLRPC_BASEURL')) {
         $editorpaths = array(JSXMLRPC_PATH[0] === '/' ? JSXMLRPC_PATH : (__DIR__ . '/' . JSXMLRPC_PATH));
     } else {
         $editorpaths = array(
-            __DIR__ . '/vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer in debugger
-            __DIR__ . '/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm in debugger
-            __DIR__ . '/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via taskfile in debugger
+            __DIR__ . '/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via taskfile
+            __DIR__ . '/vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer inside the debugger
+            __DIR__ . '/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm inside the debugger
             __DIR__ . '/../vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via composer
             __DIR__ . '/../node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is top-level, jsxmlrpc installed via npm
             __DIR__ . '/../../jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc too
-            __DIR__ . '/../../../../web/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed via npm
+            __DIR__ . '/../../../../debugger/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level via taskfile (ie. jsonrpc)
+            __DIR__ . '/../../../../debugger/vendor/phpxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level debugger via composer
+            __DIR__ . '/../../../../debugger/node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed in the top-level debugger via npm
+            __DIR__ . '/../../../../node_modules/@jsxmlrpc/jsxmlrpc/debugger/', // this package is a composer dependency, jsxmlrpc installed via npm in the top-level project
         );
     }
     foreach($editorpaths as $editorpath) {
@@ -54,7 +57,7 @@ if (defined('JSXMLRPC_BASEURL')) {
     if ($haseditor) {
         $controllerRootUrl = str_replace('/controller.php', '', parse_url($_SERVER['REQUEST_URI'],  PHP_URL_PATH));
         $editorurlpath = $controllerRootUrl . '/' . preg_replace('|^' . preg_quote(__DIR__, '|') .'|', '', $editorpath);
-        /// @todo for cases above 4, 5 and up, look at $controllerRootUrl and check if the web root is not pointing directly
+        /// @todo for cases above 4 and up, look at $controllerRootUrl and check if the web root is not pointing directly
         ///       at this folder, as in that case the link to the visualeditor will not
         ///       work, as it will be in the form http(s)://domain/../../jsxmlrpc/debugger/visualeditor.html
     }
index 30cc317..33876d9 100644 (file)
@@ -3,6 +3,7 @@
  * XML-RPC server acting as proxy for requests to other servers
  * (useful e.g. for js-originated calls that can only connect back to the originating server because of the same-domain policy).
  * NB: this is an OPEN RELAY. It is meant as a demo, not to be used in production!
+ *
  * For an example of a transparent reverse-proxy, see the ReverseProxy class in package phpxmlrpc/extras.
  *
  * The source code demonstrates: