* benchmark.php, xmlrpc_wrappers.inc: remove usage of split(), deprecated in\r
php 5.3\r
\r
+ * benchmark.php: fixed url of server page used for testing; improved\r
+ verification of correspondence of test results; added more variants for\r
+ http options comparison\r
+\r
+ * verify_compat.php: check for php version 5 for client side too\r
+\r
+ * makefile: remove from build the compat directory\r
+\r
2009-07-26 - G. Giunta (giunta.gaetano@gmail.com)\r
\r
* server.php: remove usage of ereg*(), deprecated in php 5.3\r
# on unix shells lasts char should be \\2/g )\r
export VERSION=$(shell egrep "\$GLOBALS *\[ *'xmlrpcVersion' *\] *= *'" lib/xmlrpc.inc | sed -r s/"(.*= *' *)([0-9a-zA-Z.-]+)(.*)"/\2/g )\r
\r
-LIBFILES=lib/xmlrpc.inc lib/xmlrpcs.inc lib/xmlrpc_wrappers.inc lib/compat/*.php\r
+LIBFILES=lib/xmlrpc.inc lib/xmlrpcs.inc lib/xmlrpc_wrappers.inc\r
\r
EXTRAFILES=extras/test.pl \\r
extras/test.py \\r
${MKDIR} xmlrpc-${VERSION}/test/PHPUnit\r
${MKDIR} xmlrpc-${VERSION}/extras\r
${MKDIR} xmlrpc-${VERSION}/lib\r
- ${MKDIR} xmlrpc-${VERSION}/lib/compat\r
${MKDIR} xmlrpc-${VERSION}/debugger\r
cp --parents ${DEMOFILES} xmlrpc-${VERSION}\r
cp --parents ${DEMOCFILES} xmlrpc-${VERSION}\r
\r
This release corrects all bugs that have been reported and sucesfully reproduced since\r
version 2.2.1.\r
-Regardless of the intimitading message about dropping PHP 4 support, it still does\r
+Regardless of the intimidating message about dropping PHP 4 support, it still does\r
support that ancient, broken and insecure platform.\r
\r
* fixed: php warning when receiving 'false' in a bool value\r
$server = 'http://'.$server;
}
if ($proxy != '') {
- $pproxy = split(':', $proxy);
+ $pproxy = explode(':', $proxy);
if (count($pproxy) > 1)
$pport = $pproxy[1];
else
* @version $Id$
* @copyright (c) 2005-2009 G. Giunta
* @license code licensed under the BSD License: http://phpxmlrpc.sourceforge.net/license.txt
+ *
+ * @todo add a test for response ok in call testing?
**/
-
+ini_set('max_execution_time', 300);
include(getcwd().'/parse_args.php');
require_once('xmlrpc.inc');
echo "<h3>Using lib version: $xmlrpcVersion on PHP version: ".phpversion()."</h3>\n";
if ($xd) echo "<h4>XDEBUG profiling enabled: skipping remote tests. Trace file is: ".htmlspecialchars(xdebug_get_profiler_filename())."</h4>\n";
flush();
+ ob_flush();
}
else
{
$values[] = new xmlrpcval($val[2], 'string');
$values[] = new xmlrpcval($val[3], 'boolean');
$values[] = new xmlrpcval($val[4], 'dateTime.iso8601');
- $values[] = new xmlrpcval($val[5], 'i4');
+ $values[] = new xmlrpcval($val[5], 'int');
$values[] = new xmlrpcval($val[6], 'double');
$values[] = new xmlrpcval($val[7], 'string');
$values[] = new xmlrpcval($val[8], 'boolean');
if (!$xd) {
/// test multicall vs. many calls vs. keep-alives
- $value = php_xmlrpc_encode($data1);
+ $value = php_xmlrpc_encode($data1, array('auto_dates'));
$msg = new xmlrpcmsg('interopEchoTests.echoValue', array($value));
$msgs=array();
for ($i = 0; $i < 25; $i++)
begin_test('Repeated send (small array)', 'multicall');
$response =& $c->send($msgs);
+ foreach ($response as $key =>& $val)
+ {
+ $val = $val->value();
+ }
end_test('Repeated send (small array)', 'multicall', $response);
if (function_exists('gzinflate'))
$response[] = $resp->value();
}
end_test('Repeated send (small array)', 'http 10 w. compression', $response);
+
+ if (function_exists('curl_init'))
+ {
+ begin_test('Repeated send (small array)', 'http 11 w. keep-alive and compression');
+ $response = array();
+ for ($i = 0; $i < 25; $i++)
+ {
+ $resp =& $c->send($msg, 10, 'http11');
+ $response[] = $resp->value();
+ }
+ end_test('Repeated send (small array)', 'http 11 w. keep-alive and compression', $response);
+
+ $c->keepalive = false;
+ begin_test('Repeated send (small array)', 'http 11 w. compression');
+ $response = array();
+ for ($i = 0; $i < 25; $i++)
+ {
+ $resp =& $c->send($msg, 10, 'http11');
+ $response[] = $resp->value();
+ }
+ end_test('Repeated send (small array)', 'http 11 w. compression', $response);
+ }
+
+ begin_test('Repeated send (small array)', 'multicall w. compression');
+ $response =& $c->send($msgs);
+ foreach ($response as $key =>& $val)
+ {
+ $val = $val->value();
+ }
+ end_test('Repeated send (small array)', 'multicall w. compression', $response);
}
} // end of 'if no xdebug profiling'
if (!isset($test_results[$test_name]))
$test_results[$test_name]=array();
$test_results[$test_name][$test_case] = array();
- list($micro, $sec) = explode(' ', microtime());
- $test_results[$test_name][$test_case]['time'] = $sec + $micro;
+ $test_results[$test_name][$test_case]['time'] = microtime(true);
}
function end_test($test_name, $test_case, $test_result)
{
global $test_results;
- list($micro, $sec) = explode(' ', microtime());
+ $end = microtime(true);
if (!isset($test_results[$test_name][$test_case]))
trigger_error('ending test that was not sterted');
- $test_results[$test_name][$test_case]['time'] = $sec + $micro - $test_results[$test_name][$test_case]['time'];
+ $test_results[$test_name][$test_case]['time'] = $end - $test_results[$test_name][$test_case]['time'];
$test_results[$test_name][$test_case]['result'] = $test_result;
echo '.';
flush();
+ ob_flush();
}
{
$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
* @author Gaetano Giunta
* @copyright (C) 2006-2009 G. Giunta
* @license code licensed under the BSD License: http://phpxmlrpc.sourceforge.net/license.txt
+ *
+ * @todo add a test for php output buffering?
*/
-// be backward compat up to version 4.0.5...
-if (!function_exists('version_compare'))
-{
- // give an opportunity to user to specify where to include other files from
- if(!defined('PHP_XMLRPC_COMPAT_DIR'))
- {
- define('PHP_XMLRPC_COMPAT_DIR',dirname(__FILE__).'/compat/');
- }
- include(PHP_XMLRPC_COMPAT_DIR.'version_compare.php');
-}
-
function phpxmlrpc_verify_compat($mode='client')
{
$tests = array();
$tests['zlib']['description'] = "The zlib extension is enabled.\n\nYou will be able to receive compressed requests and send compressed responses for the 'HTTP' protocol";
}
- // test for diaply of php errors in xml reponse
+ // test for dispaly of php errors in xml reponse
if (ini_get('display_errors'))
{
if (intval(ini_get('error_reporting')) && E_NOTICE )
$ver = phpversion();
$tests['php_version'] = array();
$tests['php_version']['description'] = 'PHP version found: '.$ver.".\n\n";
- if (version_compare($ver, '4') < 0)
+ if (version_compare($ver, '5') < 0)
{
$tests['php_version']['status'] = 0;
- $tests['php_version']['description'] .= 'This version of PHP is not compatible with the PHP XMLRPC library. Please upgrade to 4.2 or later';
- }
- else if (version_compare($ver, '4.2') < 0)
- {
- $tests['php_version']['status'] = 1;
- $tests['php_version']['description'] .= "This version of PHP is partially compatible with the PHP XMLRPC library.\nIn order to use the library, you will need to make sure the files from the compat directory are available on your server";
+ $tests['php_version']['description'] .= 'This version of PHP is not compatible with the PHP XMLRPC library. Please upgrade to 5.0 or later';
}
else
{