1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
|
<?php
/**
* List of various interop and wiki servers to test against.
* interop for the basic library functionality, and then the wiki API.
*/
if (empty($GLOBALS['SERVER_NAME'])) {
global $HTTP_SERVER_VARS;
$GLOBALS['SERVER_NAME'] = $HTTP_SERVER_VARS['SERVER_NAME'];
$GLOBALS['SERVER_PORT'] = $HTTP_SERVER_VARS['SERVER_PORT'];
$GLOBALS['PHP_SELF'] = $HTTP_SERVER_VARS['SCRIPT_NAME'];
}
function get_user_server() {
return
array('title' => "user defined",
'desc' => "Enter your own server to test against",
'args' => null,
'host' => $GLOBALS['HTTP_GET_VARS']['user_host'],
'uri' => $GLOBALS['HTTP_GET_VARS']['user_uri'],
'port' => ($GLOBALS['HTTP_GET_VARS']['user_port'] ? $GLOBALS['HTTP_GET_VARS']['user_port'] : 80),
'type' => "user"
);
}
function get_wiki_servers($include_user=true) {
$list =
array (
array('title' => " local ",
'info_link' => "http://".$GLOBALS['SERVER_NAME'].dirname($GLOBALS['PHP_SELF'])."/../../index.php",
'args' => null,
'host' => $GLOBALS['SERVER_NAME'],
'uri' => dirname($GLOBALS['PHP_SELF'])."/../../index.php",
'port' => $GLOBALS['SERVER_PORT'],
"default" => true
),
array('title' => "local dba-test",
'info_link' => "http://".$GLOBALS['SERVER_NAME']."/wiki/dba",
'args' => null,
'host' => $GLOBALS['SERVER_NAME'],
'uri' => "/wiki/dba",
'port' => 80
),
array('title' => "local pear-test",
'info_link' => "http://".$GLOBALS['SERVER_NAME']."/wiki/pear",
'args' => null,
'host' => $GLOBALS['SERVER_NAME'],
'uri' => "/wiki/pear",
'port' => 80
),
array('title' => "local adodb-test",
'info_link' => "http://".$GLOBALS['SERVER_NAME']."/wiki/adodb",
'args' => null,
'host' => $GLOBALS['SERVER_NAME'],
'uri' => "/wiki/adodb",
'port' => 80
),
array('title' => "PhpWiki",
'info_link' => "http://phpwiki.sourceforge.net/phpwiki/",
'args' => null,
'host' => "phpwiki.sourceforge.net",
'uri' => "/phpwiki/",
'port' => 80
),
array('title' => "PhpWikiDemo",
'info_link' => "http://phpwiki.sourceforge.net/demo/",
'args' => null,
'host' => "phpwiki.sourceforge.net",
'uri' => "/demo/",
'port' => 80
),
);
if($include_user) {
$list[] = get_user_server();
}
return $list;
}
function get_intro_useful_servers($include_user=true) {
$list =
array (
array('title' => "xmlrpc-epi ( local! )",
'info_link' => "http://".$GLOBALS['SERVER_NAME'].dirname($GLOBALS['PHP_SELF'])."/interop-server.php",
'args' => null,
'host' => $GLOBALS['SERVER_NAME'],
'uri' => substr($GLOBALS['PHP_SELF'], 0, strrpos($GLOBALS['PHP_SELF'], "/") + 1) . "interop-server.php",
'port' => $GLOBALS['SERVER_PORT'],
"default" => true
),
array('title' => "Meerkat",
'info_link' => "http://www.oreillynet.com/meerkat/xml-rpc/",
'args' => null,
'host' => "www.oreillynet.com",
'uri' => "/meerkat/xml-rpc/server.php",
'port' => 80
),
array('title' => "Usefulinc",
'info_link' => "http://xmlrpc.usefulinc.com/php.html",
'args' => null,
'host' => "xmlrpc.usefulinc.com",
'uri' => "/demo/server.php",
'port' => 80
),
);
if($include_user) {
$list[] = get_user_server();
}
return $list;
}
function get_introspection_servers($include_user=true) {
$list =
array (
array('title' => "xmlrpc-epi interop server",
'info_link' => "http://".$GLOBALS['SERVER_NAME'].dirname($GLOBALS['PHP_SELF'])."/interop-server.php",
'args' => null,
'host' => $GLOBALS['SERVER_NAME'],
'uri' => substr($GLOBALS['PHP_SELF'], 0, strrpos($GLOBALS['PHP_SELF'], "/") + 1) . "interop-server.php",
'port' => $GLOBALS['SERVER_PORT'],
"default" => true
),
array('title' => "xmlrpc-epi validation server",
'info_link' => "http://".$GLOBALS['SERVER_NAME'].dirname($GLOBALS['PHP_SELF'])."/validate.php",
'args' => null,
'host' => $GLOBALS['SERVER_NAME'],
'uri' => substr($GLOBALS['PHP_SELF'], 0, strrpos($GLOBALS['PHP_SELF'], "/") + 1) . "validate.php",
'port' => $GLOBALS['SERVER_PORT'],
),
);
if($include_user) {
$list[] = get_user_server();
}
return $list;
}
function get_interop_servers($include_user=true) {
global $HTTP_SERVER_VARS;
$list =
array (
array('title' => "local xmlrpc interop-server",
'info_link' => "http://".$GLOBALS['SERVER_NAME'].dirname($GLOBALS['PHP_SELF'])."/interop-server.php",
'desc' => "a php C extension utilizing the xmlrpc-epi library. running locally. by Dan Libby",
'args' => "",
'host' => $HTTP_SERVER_VARS['SERVER_NAME'],
'uri' => dirname($HTTP_SERVER_VARS['SCRIPT_NAME']) . "/interop-server.php",
'port' => $HTTP_SERVER_VARS['SERVER_PORT'],
"default" => true
),
array('title' => "Frontier 7.0b43",
'info_link' => "http://groups.yahoo.com/group/xml-rpc/message/2585",
'desc' => "Jake Savin's Server. First Interop Node",
'args' => "",
'host' => "www.soapware.org",
'uri' => "/RPC2",
'port' => 80
),
array('title' => "XMLRPC.Net",
'info_link' => "http://aspx.securedomains.com/cookcomputing/interopechotests.aspx",
'desc' => "client/server by Charles Cook",
'args' => "",
'host' => "aspx.securedomains.com",
'uri' => "/cookcomputing/interopechotests.aspx",
'port' => 80
),
array('title' => "xmlrpc-c",
'info_link' => "http://xmlrpc-c.sourceforge.net",
'desc' => "a C library by Eric Kidd",
'args' => "",
'host' => "xmlrpc-c.sourceforge.net",
'uri' => "/cgi-bin/interop.cgi",
'port' => 80
),
array('title' => "Usefulinc",
'info_link' => "http://xmlrpc.usefulinc.com/",
'desc' => "a PHP script library by Edd Dumbill",
'args' => "",
'host' => "xmlrpc.usefulinc.com",
'uri' => "/demo/server.php",
'port' => 80
),
array('title' => "XML-RPC for ASP",
'info_link' => "http://aspxmlrpc.sourceforge.net",
'args' => "",
'host' => "www.wc.cc.va.us",
'uri' => "/dtod/xmlrpc/testing/interop.asp",
'port' => 80
),
array('title' => "Frontier-RPC 0.07b3 (Perl)",
'args' => "",
'host' => "bitsko.slc.ut.us",
'uri' => "/cgi-bin/interop.pl",
'port' => 80
),
array('title' => "XMLRPC::Lite, v0.50",
'args' => "",
'host' => "xmlrpc.soaplite.com",
'uri' => "/interop.cgi",
'port' => 80
)
);
if($include_user) {
$list[] = get_user_server();
}
return $list;
}
function print_servers_form($server_list, $action_url=false, $print_user=true) {
$action = $action_url ? "action='$action_url'" : "";
echo "<form method='get' $action>";
foreach ($server_list as $key => $server) {
$title = $server['title'];
$link = $server['info_link'];
$type = $server['type'];
$port = $server['port'];
$default = $server["default"] ? "checked" : "";
if($link) {
$title = "<a href='$link'>$title</a>";
}
echo "<input type='radio' name='server' value='$key' $default> $title<br>";
if($type === "user") {
echo "<DL><DT><DL><DT>host: <input type='text' name='user_host' size='50'></DT>" .
"<DT>uri: <input type='text' name='user_uri' size='50'>" .
"<DT>port: <input type='text' name='user_port' size='4' MAXLENGTH='4' VALUE='$port'></DT></DL></DT></DL>";
}
}
if ($GLOBALS['HTTP_GET_VARS']['start_debug'])
echo "<input type='hidden' name='start_debug' value='1'>";
echo <<< END
<h3>Verbosity level</h3>
<input type='radio' name='debug' value='0' checked>none
<input type='radio' name='debug' value='1'>some
<input type='radio' name='debug' value='2'>much
<h3>XML Serialization</h3>
<input type='radio' name='version' value='xmlrpc' checked>XML-RPC
<input type='radio' name='version' value='soap 1.1'>SOAP
<input type='radio' name='version' value='simple'>simpleRPC
<p>
<input type='submit' value='Start test'>
</form>
END;
}
function get_server_from_user($server_list) {
return $server_list[$GLOBALS['HTTP_GET_VARS']['server']];
}
function server_uri_vars() {
extract($GLOBALS['HTTP_GET_VARS']);
return "server=$server&user_host=$user_host&user_port=$user_port&user_uri=$user_uri";
}
function server_vars() {
extract($GLOBALS['HTTP_GET_VARS']);
return array(
'server' => $server,
'user_host' => $user_host,
'user_port' => $user_port,
'user_uri' => $user_uri
);
}
?>
|