add support for setting ssl version to use
[plcapi.git] / test / parse_args.php
index 5b5c8fb..151d943 100644 (file)
@@ -9,8 +9,7 @@
  * @param string  HTTPSSURI
  * @param string  PROXY
  *
- * @version $Id$
- * @copyright (C) 2007-2009 G. Giunta
+ * @copyright (C) 2007-20013 G. Giunta
  * @license code licensed under the BSD License: http://phpxmlrpc.sourceforge.net/license.txt
  **/
 
@@ -35,7 +34,8 @@
                                $param = explode('=', $param);
                                if(count($param) > 1)
                                {
-                                       $$param[0]=$param[1];
+                                       $pname = $param[0];
+                                       $$pname = $param[1];
                                }
                        }
                }
        {
                $HTTPSURI = '/server.php';
        }
+       if(!isset($HTTPSIGNOREPEER))
+       {
+               $HTTPSIGNOREPEER = false;
+       }
+       if(!isset($HTTPSVERIFYHOST))
+       {
+               $HTTPSVERIFYHOST = 2;
+       }
+       if(!isset($SSLVERSION))
+       {
+               $SSLVERSION = 0;
+       }
        if(!isset($PROXY))
        {
                $PROXYSERVER = null;
                        $PROXYPORT = 8080;
                }
        }
+    // used to silence testsuite warnings about proxy code not being tested
+    if(!isset($NOPROXY))
+    {
+        $NOPROXY = false;
+    }
        if(!isset($URI))
        {
                // GUESTIMATE the url of local demo server
                {
                        $URI = str_replace('/test/testsuite.php', '/demo/server/server.php', $REQUEST_URI);
                        $URI = str_replace('/testsuite.php', '/server.php', $URI);
-                       $URI = str_replace('/test/benchmark.php', '/server.php', $URI);
+                       $URI = str_replace('/test/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('/test/testsuite.php', '/demo/server/server.php', $_SERVER['PHP_SELF']);
                        $URI = str_replace('/testsuite.php', '/server.php', $URI);
-                       $URI = str_replace('/test/benchmark.php', '/server.php', $URI);
+                       $URI = str_replace('/test/benchmark.php', '/demo/server/server.php', $URI);
                        $URI = str_replace('/benchmark.php', '/server.php', $URI);
                }
                else
        {
                $LOCALPATH = dirname(__FILE__);
        }
-?>
+?>
\ No newline at end of file