WIP tests on Docker
authorgggeek <giunta.gaetano@gmail.com>
Fri, 11 Dec 2020 15:05:45 +0000 (15:05 +0000)
committergggeek <giunta.gaetano@gmail.com>
Fri, 11 Dec 2020 15:05:45 +0000 (15:05 +0000)
20 files changed:
.travis.yml
demo/client/_bootstrap.php
tests/2InvalidHostTest.php
tests/3LocalhostTest.php
tests/5DemofilesTest.php
tests/6DebuggerTest.php
tests/7ExtraTest.php
tests/benchmark.php
tests/ci/Dockerfile
tests/ci/config/apache_phpfpm_fastcgi [new file with mode: 0644]
tests/ci/config/apache_phpfpm_fcgid [new file with mode: 0644]
tests/ci/config/apache_phpfpm_proxyfccgi [new file with mode: 0644]
tests/ci/config/apache_vhost
tests/ci/docker/entrypoint.sh
tests/ci/setup/create_user.sh
tests/ci/setup/setup_apache.sh
tests/ci/setup/setup_composer.sh [moved from tests/ci/setup/get_composer.sh with 58% similarity]
tests/ci/setup/setup_php.sh
tests/ci/vm.sh
tests/parse_args.php

index bcb3af8..365eb35 100644 (file)
@@ -7,7 +7,7 @@ dist: xenial
 
 env:
     global:
-        - LOCALSERVER=localhost
+        - HTTPSERVER=localhost
         - URI=/demo/server/server.php
         - HTTPSSERVER=localhost
         - HTTPSURI=/demo/server/server.php
index d705d64..0645d3a 100644 (file)
@@ -3,23 +3,23 @@
  * Hackish code used to make the demos both viewable as source, runnable, and viewable as html
  */
 
-// Make errors visible
-ini_set('display_errors', true);
-error_reporting(E_ALL);
-
 if (isset($_GET['showSource']) && $_GET['showSource']) {
     $file = debug_backtrace()[0]['file'];
     highlight_file($file);
     die();
 }
 
+// Make errors visible
+ini_set('display_errors', true);
+error_reporting(E_ALL);
+
 // Use the custom class autoloader. These two lines not needed when the phpxmlrpc library is installed using Composer
 include_once __DIR__ . '/../../src/Autoloader.php';
 PhpXmlRpc\Autoloader::register();
 
 // Let unit tests run against localhost, 'plain' demos against a known public server
-if (isset($_SERVER['LOCALSERVER'])) {
-    define('XMLRPCSERVER', 'http://'.$_SERVER['LOCALSERVER'].'/demo/server/server.php');
+if (isset($_SERVER['HTTPSERVER'])) {
+    define('XMLRPCSERVER', 'http://'.$_SERVER['HTTPSERVER'].'/demo/server/server.php');
 } else {
     define('XMLRPCSERVER', 'http://phpxmlrpc.sourceforge.net/server.php');
 }
index 0607c51..18c8f6c 100644 (file)
@@ -19,7 +19,7 @@ class InvalidHostTest extends PhpXmlRpc_PolyfillTestCase
     {
         $this->args = argParser::getArgs();
 
-        $this->client = new xmlrpc_client('/NOTEXIST.php', $this->args['LOCALSERVER'], 80);
+        $this->client = new xmlrpc_client('/NOTEXIST.php', $this->args['HTTPSERVER'], 80);
         $this->client->setDebug($this->args['DEBUG']);
 
         if ($this->args['DEBUG'] == 1)
@@ -81,12 +81,12 @@ class InvalidHostTest extends PhpXmlRpc_PolyfillTestCase
         $this->assertTrue($r->faultCode() === 8 || $r->faultCode() == 5);
 
         // now test a successful connection
-        $server = explode(':', $this->args['LOCALSERVER']);
+        $server = explode(':', $this->args['HTTPSERVER']);
         if (count($server) > 1) {
             $this->client->port = $server[1];
         }
         $this->client->server = $server[0];
-        $this->client->path = $this->args['URI'];
+        $this->client->path = $this->args['HTTPURI'];
 
         $r = $this->client->send($m, 5, 'http11');
         $this->assertEquals(0, $r->faultCode());
index 9cbd1fd..439b635 100644 (file)
@@ -87,18 +87,18 @@ class LocalhostTest extends PhpXmlRpc_PolyfillTestCase
     {
         $this->args = argParser::getArgs();
 
-        $server = explode(':', $this->args['LOCALSERVER']);
+        $server = explode(':', $this->args['HTTPSERVER']);
         if (count($server) > 1) {
-            $this->client = new xmlrpc_client($this->args['URI'], $server[0], $server[1]);
+            $this->client = new xmlrpc_client($this->args['HTTPURI'], $server[0], $server[1]);
         } else {
-            $this->client = new xmlrpc_client($this->args['URI'], $this->args['LOCALSERVER']);
+            $this->client = new xmlrpc_client($this->args['HTTPURI'], $this->args['HTTPSERVER']);
         }
 
         $this->client->setDebug($this->args['DEBUG']);
         $this->client->request_compression = $this->request_compression;
         $this->client->accepted_compression = $this->accepted_compression;
 
-        $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] );
+        $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] );
 
         if ($this->args['DEBUG'] == 1)
             ob_start();
index e064add..583be3f 100644 (file)
@@ -11,9 +11,9 @@ class DemoFilesTest extends PhpXmlRpc_LocalFileTestCase
     {
         $this->args = argParser::getArgs();
 
-        $this->baseUrl = $this->args['LOCALSERVER'] . str_replace( '/demo/server/server.php', '/demo/', $this->args['URI'] );
+        $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/demo/', $this->args['HTTPURI'] );
 
-        $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] );
+        $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] );
     }
 
     public function testAgeSort()
index eaacd43..b0e7948 100644 (file)
@@ -8,9 +8,9 @@ class DebuggerTest extends PhpXmlRpc_LocalFileTestCase
     {
         $this->args = argParser::getArgs();
 
-        $this->baseUrl = $this->args['LOCALSERVER'] . str_replace( '/demo/server/server.php', '/debugger/', $this->args['URI'] );
+        $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/debugger/', $this->args['HTTPURI'] );
 
-        $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] );
+        $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] );
     }
 
     public function testIndex()
index de7d48f..5770eca 100644 (file)
@@ -11,9 +11,9 @@ class ExtraTest extends PhpXmlRpc_LocalFileTestCase
     {
         $this->args = argParser::getArgs();
 
-        $this->baseUrl = $this->args['LOCALSERVER'] . str_replace( '/demo/server/server.php', '/tests/', $this->args['URI'] );
+        $this->baseUrl = $this->args['HTTPSERVER'] . str_replace( '/demo/server/server.php', '/tests/', $this->args['HTTPURI'] );
 
-        $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] );
+        $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] );
     }
 
     public function testVerifyCompat()
index 3f0a470..8ef4587 100644 (file)
@@ -206,13 +206,13 @@ if (!$xd) {
     for ($i = 0; $i < 25; $i++) {
         $reqs[] = $req;
     }
-    $server = explode(':', $args['LOCALSERVER']);
+    $server = explode(':', $args['HTTPSERVER']);
     if (count($server) > 1) {
-        $srv = $server[1] . '://' . $server[0] . $args['URI'];
-        $c = new Client($args['URI'], $server[0], $server[1]);
+        $srv = $server[1] . '://' . $server[0] . $args['HTTPURI'];
+        $c = new Client($args['HTTPURI'], $server[0], $server[1]);
     } else {
-        $srv = $args['LOCALSERVER'] . $args['URI'];
-        $c = new Client($args['URI'], $args['LOCALSERVER']);
+        $srv = $args['HTTPSERVER'] . $args['HTTPURI'];
+        $c = new Client($args['HTTPURI'], $args['HTTPSERVER']);
     }
     // do not interfere with http compression
     $c->accepted_compression = array();
index a604020..7fb27de 100644 (file)
@@ -4,20 +4,19 @@ FROM ubuntu:${UBUNTU_VERSION}
 
 ARG PHP_VERSION=default
 
-RUN mkdir -p /usr/share/man/man1 && \
-      apt-get update
-
 COPY setup/*.sh /root/setup/
 COPY config/* /root/config/
 
-RUN chmod 755 /root/setup/*.sh && \
+RUN mkdir -p /usr/share/man/man1 && \
+  apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y upgrade && \
+  chmod 755 /root/setup/*.sh && \
   cd /root/setup && \
   ./install_packages.sh && \
   ./create_user.sh && \
   ./setup_apache.sh && \
   ./setup_privoxy.sh && \
   ./setup_php.sh "${PHP_VERSION}" && \
-  apt-get remove -y composer || echo An error on the line above is ok; ./get_composer.sh && mv /usr/local/bin/composer.phar /usr/local/bin/composer && chmod 755 /usr/local/bin/composer
+  ./setup_composer.sh
 
 COPY docker/entrypoint.sh /root/entrypoint.sh
 RUN chmod 755 /root/entrypoint.sh
diff --git a/tests/ci/config/apache_phpfpm_fastcgi b/tests/ci/config/apache_phpfpm_fastcgi
new file mode 100644 (file)
index 0000000..4c64b5c
--- /dev/null
@@ -0,0 +1,12 @@
+# @todo check: is this limited to php5 only?
+
+# Wire up Apache to use php-fpm via mod_fastcgi.
+<IfModule mod_fastcgi.c>
+    AddHandler php5-fcgi .php
+    Action php5-fcgi /php5-fcgi
+    Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
+    FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
+    <Directory /usr/lib/cgi-bin>
+        Require all granted
+    </Directory>
+</IfModule>
diff --git a/tests/ci/config/apache_phpfpm_fcgid b/tests/ci/config/apache_phpfpm_fcgid
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/ci/config/apache_phpfpm_proxyfccgi b/tests/ci/config/apache_phpfpm_proxyfccgi
new file mode 100644 (file)
index 0000000..bac168d
--- /dev/null
@@ -0,0 +1,25 @@
+# @todo check: templatize this, to make it work with any php version
+
+# Redirect to local php-fpm if mod_php is not available
+<IfModule !mod_php7.c>
+<IfModule proxy_fcgi_module>
+    # Enable http authorization headers
+    <IfModule setenvif_module>
+        SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
+    </IfModule>
+
+    <FilesMatch ".+\.ph(ar|p|tml)$">
+        SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost"
+    </FilesMatch>
+    <FilesMatch ".+\.phps$">
+        # Deny access to raw php sources by default
+        # To re-enable it's recommended to enable access to the files
+        # only in specific virtual host or directory
+        Require all denied
+    </FilesMatch>
+    # Deny access to files without filename (e.g. '.php')
+    <FilesMatch "^\.ph(ar|p|ps|tml)$">
+        Require all denied
+    </FilesMatch>
+</IfModule>
+</IfModule>
index 0b821ce..bf7db16 100644 (file)
@@ -1,4 +1,6 @@
-# Uses env var: TESTS_ROOT_DIR
+# Uses env vars:
+# HTTPSERVER
+# TESTS_ROOT_DIR
 
 <VirtualHost *:80>
 
@@ -7,6 +9,9 @@
   ErrorLog "${TESTS_ROOT_DIR}/apache_error.log"
   CustomLog "${TESTS_ROOT_DIR}/apache_access.log" combined
 
+  # Env vars used by the test code, which we get from the environment
+  SetEnv HTTPSERVER ${HTTPSERVER}
+
   <Directory "${TESTS_ROOT_DIR}">
     Options FollowSymLinks MultiViews
     AllowOverride All
@@ -30,6 +35,9 @@
   ErrorLog "${TESTS_ROOT_DIR}/apache_error.log"
   CustomLog "${TESTS_ROOT_DIR}/apache_access.log" combined
 
+  # Env vars used by the test code, which we get from the environment
+  SetEnv HTTPSERVER ${HTTPSERVER}
+
   <Directory "${TESTS_ROOT_DIR}">
     Options FollowSymLinks MultiViews
     AllowOverride All
index 2642cc0..658d8e3 100644 (file)
@@ -44,9 +44,10 @@ fi
 
 echo "[$(date)] Fixing apache configuration..."
 
-# @todo set as well APACHE_RUN_USER and/or APACHE_RUN_GROUP ?
 sed -e "s?^export TESTS_ROOT_DIR=.*?export TESTS_ROOT_DIR=${TESTS_ROOT_DIR}?g" --in-place /etc/apache2/envvars
 
+# @todo set as well php-fpm user/group ?
+
 echo "[$(date)] Running Composer..."
 
 sudo test -c "cd /home/test && composer install"
index b92951d..67adae5 100644 (file)
@@ -7,14 +7,16 @@ set -e
 
 USERNAME="${1:-test}"
 
-addgroup --gid 1013 ${USERNAME}
-adduser --system --uid=1013 --gid=1013 --home /home/${USERNAME} --shell /bin/bash ${USERNAME}
-adduser ${USERNAME} ${USERNAME}
+addgroup --gid 1013 "${USERNAME}"
+adduser --system --uid=1013 --gid=1013 --home "/home/${USERNAME}" --shell /bin/bash "${USERNAME}"
+adduser "${USERNAME}" "${USERNAME}"
 
-mkdir -p /home/${USERNAME}/.ssh
-cp /etc/skel/.[!.]* /home/${USERNAME}
+mkdir -p "/home/${USERNAME}/.ssh"
+cp /etc/skel/.[!.]* "/home/${USERNAME}"
 
-adduser ${USERNAME} sudo
-sed -i "\$ a ${USERNAME}   ALL=\(ALL:ALL\) NOPASSWD: ALL" /etc/sudoers
+chown -R "${USERNAME}:${USERNAME}" "/home/${USERNAME}"
 
-chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}
+if [ -f /etc/sudoers ]; then
+    adduser "${USERNAME}" sudo
+    sed -i "\$ a ${USERNAME}   ALL=\(ALL:ALL\) NOPASSWD: ALL" /etc/sudoers
+fi
index 5faee24..781f203 100644 (file)
@@ -24,5 +24,6 @@ if [ -n "${TRAVIS}" ]; then
 else
     echo "export TESTS_ROOT_DIR=/var/www/html" >> /etc/apache2/envvars
 fi
+echo "export HTTPSERVER=localhost" >> /etc/apache2/envvars
 
 service apache2 restart
similarity index 58%
rename from tests/ci/setup/get_composer.sh
rename to tests/ci/setup/setup_composer.sh
index ba2d2a1..cd2f81c 100644 (file)
@@ -3,6 +3,12 @@
 # Installs Composer (latest version, to avoid relying on old ones bundled with the OS)
 # @todo allow users to lock down to Composer v1 if needed
 
+if dpkg -l composer 2>/dev/null; then
+    apt-get remove -y composer
+fi
+
+### Code below taken from https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md
+
 EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)"
 php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
 ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
@@ -14,7 +20,14 @@ then
     exit 1
 fi
 
-php composer-setup.php --install-dir=/usr/local/bin
+php composer-setup.php --quiet --install-dir=/usr/local/bin
 RESULT=$?
 rm composer-setup.php
+
+###
+
+if [ -f /usr/local/bin/composer.phar -a "$RESULT" = 0 ]; then
+    mv /usr/local/bin/composer.phar /usr/local/bin/composer && chmod 755 /usr/local/bin/composer
+fi
+
 exit $RESULT
index d9624de..fe9e0b0 100644 (file)
@@ -7,9 +7,10 @@ configure_php_ini() {
     echo "cgi.fix_pathinfo = 1" >> "${1}"
     echo "always_populate_raw_post_data = -1" >> "${1}"
 
+    # @todo this only disables xdebug for CLI. To do the same for the FPM config as well, should we use instead `phpdismod` ?
     XDEBUG_INI=$(php -i | grep xdebug.ini | grep -v '=>' | head -1)
     if [ "$XDEBUG_INI" != "" ]; then
-        #XDEBUG_INI=${XDEBUG_INI/,/}
+        XDEBUG_INI="$(echo "$XDEBUG_INI" | tr -d ',')"
         mv "$XDEBUG_INI" "$XDEBUG_INI.bak";
     fi
 }
@@ -17,8 +18,8 @@ configure_php_ini() {
 if ! which php >/dev/null; then
 
     # install php
-    PHP_VERSION=$1
-    DEBIAN_VERSION=$(lsb_release -s -c)
+    PHP_VERSION="$1"
+    DEBIAN_VERSION="$(lsb_release -s -c)"
 
     if [ "${PHP_VERSION}" = default ]; then
         if [ "${DEBIAN_VERSION}" = jessie -o "${DEBIAN_VERSION}" = precise -o "${DEBIAN_VERSION}" = trusty ]; then
@@ -36,12 +37,6 @@ if ! which php >/dev/null; then
             php${PHPSUFFIX}-mbstring \
             php${PHPSUFFIX}-xdebug
     else
-        #DEBIAN_FRONTEND=noninteractive apt-get install -y \
-        #    gnupg2 ca-certificates lsb-release apt-transport-https
-        #wget https://packages.sury.org/php/apt.gpg
-        #apt-key add apt.gpg
-        #echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
-
         DEBIAN_FRONTEND=noninteractive apt-get install -y language-pack-en-base software-properties-common
         LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
         apt-get update
index 8344ac8..9075c2f 100644 (file)
@@ -47,8 +47,8 @@ build() {
         -p 80:80 -p 443:443 -p 8080:8080 \
         --name "${CONTAINER_NAME}" \
         --env CONTAINER_USER_UID=$(id -u) --env CONTAINER_USER_GID=$(id -g) --env TESTS_ROOT_DIR=/home/test \
-        --env LOCALSERVER=localhost \
-        --env URI=/demo/server/server.php \
+        --env HTTPSERVER=localhost \
+        --env HTTPURI=/demo/server/server.php \
         --env HTTPSSERVER=localhost \
         --env HTTPSURI=/demo/server/server.php \
         --env PROXYSERVER=localhost:8080 \
index f9c4562..6fdef4b 100644 (file)
@@ -4,8 +4,8 @@
  * Common parameter parsing for benchmark and tests scripts.
  *
  * @param integer DEBUG
- * @param string  LOCALSERVER
- * @param string  URI
+ * @param string  HTTPSERVER
+ * @param string  HTTPURI
  * @param string  HTTPSSERVER
  * @param string  HTTPSURI
  * @param bool    HTTPSIGNOREPEER
  **/
 class argParser
 {
+    /**
+     * @return array
+     */
     public static function getArgs()
     {
+        /// @todo should we prefix all test parameters with TESTS_ ?
         $args = array(
             'DEBUG' => 0,
-            'LOCALSERVER' => 'localhost',
-            'HTTPSSERVER' => 'gggeek.altervista.org',
-            'HTTPSURI' => '/sw/xmlrpc/demo/server/server.php',
+            'HTTPSERVER' => 'localhost',
+            'HTTPURI' => null,
+            // now that we run tests in Docker by default, with a webserver set up for https, let's default to it
+            'HTTPSSERVER' => 'localhost',
+            'HTTPSURI' => null,
+            // example alternative:
+            //'HTTPSSERVER' => 'gggeek.altervista.org',
+            //'HTTPSURI' => '/sw/xmlrpc/demo/server/server.php',
             'HTTPSIGNOREPEER' => false,
             'HTTPSVERIFYHOST' => 2,
             'SSLVERSION' => 0,
             'PROXYSERVER' => null,
-            'LOCALPATH' => __DIR__,
+            //'LOCALPATH' => __DIR__,
         );
 
         // check for command line (env vars) vs. web page input params
@@ -48,30 +57,61 @@ class argParser
         if (isset($DEBUG)) {
             $args['DEBUG'] = intval($DEBUG);
         }
-        if (isset($LOCALSERVER)) {
-            $args['LOCALSERVER'] = $LOCALSERVER;
+
+        if (isset($HTTPSERVER)) {
+            $args['HTTPSERVER'] = $HTTPSERVER;
         } else {
             if (isset($HTTP_HOST)) {
-                $args['LOCALSERVER'] = $HTTP_HOST;
+                $args['HTTPSERVER'] = $HTTP_HOST;
             } elseif (isset($_SERVER['HTTP_HOST'])) {
-                $args['LOCALSERVER'] = $_SERVER['HTTP_HOST'];
+                $args['HTTPSERVER'] = $_SERVER['HTTP_HOST'];
+            }
+        }
+
+        if (!isset($HTTPURI) || $HTTPURI == '') {
+            // GUESTIMATE the url of local demo server
+            // play nice to php 3 and 4-5 in retrieving URL of server.php
+            /// @todo filter out query string from REQUEST_URI
+            if (isset($REQUEST_URI)) {
+                $HTTPURI = str_replace('/tests/testsuite.php', '/demo/server/server.php', $REQUEST_URI);
+                $HTTPURI = str_replace('/testsuite.php', '/server.php', $HTTPURI);
+                $HTTPURI = str_replace('/tests/benchmark.php', '/demo/server/server.php', $HTTPURI);
+                $HTTPURI = str_replace('/benchmark.php', '/server.php', $HTTPURI);
+            } elseif (isset($_SERVER['PHP_SELF']) && isset($_SERVER['REQUEST_METHOD'])) {
+                $HTTPURI = str_replace('/tests/testsuite.php', '/demo/server/server.php', $_SERVER['PHP_SELF']);
+                $HTTPURI = str_replace('/testsuite.php', '/server.php', $HTTPURI);
+                $HTTPURI = str_replace('/tests/benchmark.php', '/demo/server/server.php', $HTTPURI);
+                $HTTPURI = str_replace('/benchmark.php', '/server.php', $HTTPURI);
+            } else {
+                $HTTPURI = '/demo/server/server.php';
             }
         }
+        if ($HTTPURI[0] != '/') {
+            $HTTPURI = '/' . $HTTPURI;
+        }
+        $args['HTTPURI'] = $HTTPURI;
+
         if (isset($HTTPSSERVER)) {
             $args['HTTPSSERVER'] = $HTTPSSERVER;
         }
+
+        /// @todo if $HTTPSURI is unset, and HTTPSSERVER == localhost, use HTTPURI
         if (isset($HTTPSURI)) {
             $args['HTTPSURI'] = $HTTPSURI;
         }
+
         if (isset($HTTPSIGNOREPEER)) {
             $args['HTTPSIGNOREPEER'] = (bool)$HTTPSIGNOREPEER;
         }
+
         if (isset($HTTPSVERIFYHOST)) {
             $args['HTTPSVERIFYHOST'] = (int)$HTTPSVERIFYHOST;
         }
+
         if (isset($SSLVERSION)) {
             $args['SSLVERSION'] = (int)$SSLVERSION;
         }
+
         if (isset($PROXYSERVER)) {
             $arr = explode(':', $PROXYSERVER);
             $args['PROXYSERVER'] = $arr[0];
@@ -81,31 +121,10 @@ class argParser
                 $args['PROXYPORT'] = 8080;
             }
         }
-        if (!isset($URI)) {
-            // GUESTIMATE the url of local demo server
-            // play nice to php 3 and 4-5 in retrieving URL of server.php
-            /// @todo filter out query string from REQUEST_URI
-            if (isset($REQUEST_URI)) {
-                $URI = str_replace('/tests/testsuite.php', '/demo/server/server.php', $REQUEST_URI);
-                $URI = str_replace('/testsuite.php', '/server.php', $URI);
-                $URI = str_replace('/tests/benchmark.php', '/demo/server/server.php', $URI);
-                $URI = str_replace('/benchmark.php', '/server.php', $URI);
-            } elseif (isset($_SERVER['PHP_SELF']) && isset($_SERVER['REQUEST_METHOD'])) {
-                $URI = str_replace('/tests/testsuite.php', '/demo/server/server.php', $_SERVER['PHP_SELF']);
-                $URI = str_replace('/testsuite.php', '/server.php', $URI);
-                $URI = str_replace('/tests/benchmark.php', '/demo/server/server.php', $URI);
-                $URI = str_replace('/benchmark.php', '/server.php', $URI);
-            } else {
-                $URI = '/demo/server/server.php';
-            }
-        }
-        if ($URI[0] != '/') {
-            $URI = '/' . $URI;
-        }
-        $args['URI'] = $URI;
-        if (isset($LOCALPATH)) {
-            $args['LOCALPATH'] = $LOCALPATH;
-        }
+
+        //if (isset($LOCALPATH)) {
+        //    $args['LOCALPATH'] = $LOCALPATH;
+        //}
 
         return $args;
     }