tests
authorgggeek <giunta.gaetano@gmail.com>
Sun, 6 Dec 2020 16:36:26 +0000 (16:36 +0000)
committergggeek <giunta.gaetano@gmail.com>
Sun, 6 Dec 2020 16:36:26 +0000 (16:36 +0000)
.travis.yml
tests/parse_args.php

index 1492085..7a9b1dc 100644 (file)
@@ -7,8 +7,6 @@ dist: xenial
 
 env:
     global:
-        # temp workaround to xdebug 3.0.0 bug
-        - XDEBUG_MODE=coverage
         - LOCALSERVER=localhost
         - URI=/demo/server/server.php
         - HTTPSSERVER=localhost
@@ -20,6 +18,8 @@ env:
         - HTTPSIGNOREPEER=1
         - SSLVERSION=0
         - DEBUG=0
+        # temp workaround to xdebug 3.0.0 bug
+        - XDEBUG_MODE=coverage
 
 php:
   #- 5.3
@@ -49,7 +49,7 @@ install:
 
   # Re-enable xdebug for when we need to generate code coverage
   - export COVERAGE_OPTS=""
-  - if [ "$TRAVIS_PHP_VERSION" = "7.3" -a "$XDEBUG_INI" != "" ]; then mv "$XDEBUG_INI.bak" "$XDEBUG_INI" && export COVERAGE_OPTS="--coverage-clover=coverage.clover"; fi
+  - if [ "$TRAVIS_PHP_VERSION" = "7.4" -a "$XDEBUG_INI" != "" ]; then mv "$XDEBUG_INI.bak" "$XDEBUG_INI" && export COVERAGE_OPTS="--coverage-clover=coverage.clover"; fi
 
 before_script:
   # Set up Apache and Privoxy instances inside the Travis VM and use them for testing against
index 6dc9b82..d9b3d5a 100644 (file)
@@ -36,15 +36,11 @@ class argParser
             'LOCALPATH' => __DIR__,
         );
 
-        // check for command line vs web page input params
+        // check for command line (env vars) vs. web page input params
         if (!isset($_SERVER['REQUEST_METHOD'])) {
-            if (isset($argv)) {
-                foreach ($argv as $param) {
-                    $param = explode('=', $param);
-                    if (count($param) > 1) {
-                        $pname = strtoupper(ltrim($param[0], '-'));
-                        $$pname = $param[1];
-                    }
+            foreach($_SERVER as $key => $val) {
+                if (array_key_exists($key, $args)) {
+                    $$key = $val;
                 }
             }
         } else {