3 * Common parameter parsing for benchmarks and tests scripts
6 * @param string LOCALSERVER
8 * @param string HTTPSSERVER
9 * @param string HTTPSSURI
12 * @copyright (C) 2007-20013 G. Giunta
13 * @license code licensed under the BSD License: http://phpxmlrpc.sourceforge.net/license.txt
16 // check for command line vs web page input params
17 if(!isset($_SERVER['REQUEST_METHOD']))
21 foreach($argv as $param)
23 $param = explode('=', $param);
31 elseif(!ini_get('register_globals'))
33 // play nice to 'safe' PHP installations with register globals OFF
34 // NB: we might as well consider using $_GET stuff later on...
45 $DEBUG = intval($DEBUG);
48 if(!isset($LOCALSERVER))
52 $LOCALSERVER = $HTTP_HOST;
54 elseif(isset($_SERVER['HTTP_HOST']))
56 $LOCALSERVER = $_SERVER['HTTP_HOST'];
60 $LOCALSERVER = 'localhost';
63 if(!isset($HTTPSSERVER))
65 $HTTPSSERVER = 'xmlrpc.usefulinc.com';
69 $HTTPSURI = '/server.php';
71 if(!isset($HTTPSIGNOREPEER))
73 $HTTPSIGNOREPEER = false;
81 $arr = explode(':',$PROXY);
82 $PROXYSERVER = $arr[0];
92 // used to silence testsuite warnings about proxy code not being tested
99 // GUESTIMATE the url of local demo server
100 // play nice to php 3 and 4-5 in retrieving URL of server.php
101 /// @todo filter out query string from REQUEST_URI
102 if(isset($REQUEST_URI))
104 $URI = str_replace('/test/testsuite.php', '/demo/server/server.php', $REQUEST_URI);
105 $URI = str_replace('/testsuite.php', '/server.php', $URI);
106 $URI = str_replace('/test/benchmark.php', '/demo/server/server.php', $URI);
107 $URI = str_replace('/benchmark.php', '/server.php', $URI);
109 elseif(isset($_SERVER['PHP_SELF']) && isset($_SERVER['REQUEST_METHOD']))
111 $URI = str_replace('/test/testsuite.php', '/demo/server/server.php', $_SERVER['PHP_SELF']);
112 $URI = str_replace('/testsuite.php', '/server.php', $URI);
113 $URI = str_replace('/test/benchmark.php', '/demo/server/server.php', $URI);
114 $URI = str_replace('/benchmark.php', '/server.php', $URI);
118 $URI = '/demo/server/server.php';
125 if(!isset($LOCALPATH))
127 $LOCALPATH = __DIR__;