From: gggeek Date: Fri, 11 Dec 2020 15:05:45 +0000 (+0000) Subject: WIP tests on Docker X-Git-Tag: plcapi-7.1-0~3^2~148 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=98d4ea619cef778d0cbcc706ea9a157178f90da5;p=plcapi.git WIP tests on Docker --- diff --git a/.travis.yml b/.travis.yml index bcb3af8..365eb35 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ dist: xenial env: global: - - LOCALSERVER=localhost + - HTTPSERVER=localhost - URI=/demo/server/server.php - HTTPSSERVER=localhost - HTTPSURI=/demo/server/server.php diff --git a/demo/client/_bootstrap.php b/demo/client/_bootstrap.php index d705d64..0645d3a 100644 --- a/demo/client/_bootstrap.php +++ b/demo/client/_bootstrap.php @@ -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'); } diff --git a/tests/2InvalidHostTest.php b/tests/2InvalidHostTest.php index 0607c51..18c8f6c 100644 --- a/tests/2InvalidHostTest.php +++ b/tests/2InvalidHostTest.php @@ -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()); diff --git a/tests/3LocalhostTest.php b/tests/3LocalhostTest.php index 9cbd1fd..439b635 100644 --- a/tests/3LocalhostTest.php +++ b/tests/3LocalhostTest.php @@ -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(); diff --git a/tests/5DemofilesTest.php b/tests/5DemofilesTest.php index e064add..583be3f 100644 --- a/tests/5DemofilesTest.php +++ b/tests/5DemofilesTest.php @@ -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() diff --git a/tests/6DebuggerTest.php b/tests/6DebuggerTest.php index eaacd43..b0e7948 100644 --- a/tests/6DebuggerTest.php +++ b/tests/6DebuggerTest.php @@ -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() diff --git a/tests/7ExtraTest.php b/tests/7ExtraTest.php index de7d48f..5770eca 100644 --- a/tests/7ExtraTest.php +++ b/tests/7ExtraTest.php @@ -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() diff --git a/tests/benchmark.php b/tests/benchmark.php index 3f0a470..8ef4587 100644 --- a/tests/benchmark.php +++ b/tests/benchmark.php @@ -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(); diff --git a/tests/ci/Dockerfile b/tests/ci/Dockerfile index a604020..7fb27de 100644 --- a/tests/ci/Dockerfile +++ b/tests/ci/Dockerfile @@ -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 index 0000000..4c64b5c --- /dev/null +++ b/tests/ci/config/apache_phpfpm_fastcgi @@ -0,0 +1,12 @@ +# @todo check: is this limited to php5 only? + +# Wire up Apache to use php-fpm via mod_fastcgi. + + 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 + + Require all granted + + diff --git a/tests/ci/config/apache_phpfpm_fcgid b/tests/ci/config/apache_phpfpm_fcgid new file mode 100644 index 0000000..e69de29 diff --git a/tests/ci/config/apache_phpfpm_proxyfccgi b/tests/ci/config/apache_phpfpm_proxyfccgi new file mode 100644 index 0000000..bac168d --- /dev/null +++ b/tests/ci/config/apache_phpfpm_proxyfccgi @@ -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 + + + # Enable http authorization headers + + SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1 + + + + SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost" + + + # 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 + + # Deny access to files without filename (e.g. '.php') + + Require all denied + + + diff --git a/tests/ci/config/apache_vhost b/tests/ci/config/apache_vhost index 0b821ce..bf7db16 100644 --- a/tests/ci/config/apache_vhost +++ b/tests/ci/config/apache_vhost @@ -1,4 +1,6 @@ -# Uses env var: TESTS_ROOT_DIR +# Uses env vars: +# HTTPSERVER +# TESTS_ROOT_DIR @@ -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} + 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} + Options FollowSymLinks MultiViews AllowOverride All diff --git a/tests/ci/docker/entrypoint.sh b/tests/ci/docker/entrypoint.sh index 2642cc0..658d8e3 100644 --- a/tests/ci/docker/entrypoint.sh +++ b/tests/ci/docker/entrypoint.sh @@ -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" diff --git a/tests/ci/setup/create_user.sh b/tests/ci/setup/create_user.sh index b92951d..67adae5 100644 --- a/tests/ci/setup/create_user.sh +++ b/tests/ci/setup/create_user.sh @@ -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 diff --git a/tests/ci/setup/setup_apache.sh b/tests/ci/setup/setup_apache.sh index 5faee24..781f203 100644 --- a/tests/ci/setup/setup_apache.sh +++ b/tests/ci/setup/setup_apache.sh @@ -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 diff --git a/tests/ci/setup/get_composer.sh b/tests/ci/setup/setup_composer.sh similarity index 58% rename from tests/ci/setup/get_composer.sh rename to tests/ci/setup/setup_composer.sh index ba2d2a1..cd2f81c 100644 --- a/tests/ci/setup/get_composer.sh +++ b/tests/ci/setup/setup_composer.sh @@ -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 diff --git a/tests/ci/setup/setup_php.sh b/tests/ci/setup/setup_php.sh index d9624de..fe9e0b0 100644 --- a/tests/ci/setup/setup_php.sh +++ b/tests/ci/setup/setup_php.sh @@ -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 diff --git a/tests/ci/vm.sh b/tests/ci/vm.sh index 8344ac8..9075c2f 100644 --- a/tests/ci/vm.sh +++ b/tests/ci/vm.sh @@ -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 \ diff --git a/tests/parse_args.php b/tests/parse_args.php index f9c4562..6fdef4b 100644 --- a/tests/parse_args.php +++ b/tests/parse_args.php @@ -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 @@ -18,18 +18,27 @@ **/ 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; }