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 require_once('xmlrpc.inc');
17 require_once('xmlrpcs.inc');
19 // play nice to older PHP versions that miss superglobals
22 $_SERVER = $HTTP_SERVER_VARS;
23 $_GET = isset($HTTP_GET_VARS) ? $HTTP_GET_VARS : array();
24 $_POST = isset($HTTP_POST_VARS) ? $HTTP_POST_VARS : array();
27 // check for command line vs web page input params
28 if(!isset($_SERVER['REQUEST_METHOD']))
32 foreach($argv as $param)
34 $param = explode('=', $param);
42 elseif(!ini_get('register_globals'))
44 // play nice to 'safe' PHP installations with register globals OFF
45 // NB: we might as well consider using $_GET stuff later on...
56 $DEBUG = intval($DEBUG);
59 if(!isset($LOCALSERVER))
63 $LOCALSERVER = $HTTP_HOST;
65 elseif(isset($_SERVER['HTTP_HOST']))
67 $LOCALSERVER = $_SERVER['HTTP_HOST'];
71 $LOCALSERVER = 'localhost';
74 if(!isset($HTTPSSERVER))
76 $HTTPSSERVER = 'xmlrpc.usefulinc.com';
80 $HTTPSURI = '/server.php';
88 $arr = explode(':',$PROXY);
89 $PROXYSERVER = $arr[0];
101 // GUESTIMATE the url of local demo server
102 // play nice to php 3 and 4-5 in retrieving URL of server.php
103 /// @todo filter out query string from REQUEST_URI
104 if(isset($REQUEST_URI))
106 $URI = str_replace('/test/testsuite.php', '/demo/server/server.php', $REQUEST_URI);
107 $URI = str_replace('/testsuite.php', '/server.php', $URI);
108 $URI = str_replace('/test/benchmark.php', '/demo/server/server.php', $URI);
109 $URI = str_replace('/benchmark.php', '/server.php', $URI);
111 elseif(isset($_SERVER['PHP_SELF']) && isset($_SERVER['REQUEST_METHOD']))
113 $URI = str_replace('/test/testsuite.php', '/demo/server/server.php', $_SERVER['PHP_SELF']);
114 $URI = str_replace('/testsuite.php', '/server.php', $URI);
115 $URI = str_replace('/test/benchmark.php', '/demo/server/server.php', $URI);
116 $URI = str_replace('/benchmark.php', '/server.php', $URI);
120 $URI = '/demo/server/server.php';
127 if(!isset($LOCALPATH))
129 $LOCALPATH = dirname(__FILE__);