+2009-07-16 - G. Giunta (giunta.gaetano@gmail.com) thanks Jean-Jacques Sarton\r
+\r
+ * xmlrpc.inc: add support for the <ex:nil/> from the apache library, both\r
+ in input and output\r
+\r
+ * xmlrpc.inc, testsuite.php: remove usage of split(), deprecated in php 5.3\r
+\r
+ * testsuite.php: flush better results with output_buffering on\r
+\r
+ * server: php: avoid one warning about static function calls\r
+\r
2009-07-02 - G. Giunta (giunta.gaetano@gmail.com) thanks Heiko Stuebner\r
\r
* xmlrpc.inc: fix: when checking the parameters against the signatures xmlrpc\r
\r
* create php4 branch, rename trunk to 3.0.0beta - it will be the php5-only version\r
\r
- * xmlrpc.inc: removed test fpr php version and inclusion of compat patches for really\r
+ * xmlrpc.inc: removed test for php version and inclusion of compat patches for really\r
really old versions of php 4\r
\r
2009-03-16 - G. Giunta (giunta.gaetano@gmail.com) thanks Tommaso Trani\r
return new xmlrpcresp(new xmlrpcval(1, 'boolean'));
}
- /**
- * a PHP version of the state-number server. Send me an integer and i'll sell you a state
- * @param integer $s
- * @return string
- * */
- function findstate($s)
- {
- return inner_findstate($s);
+ /**
+ * a PHP version of the state-number server. Send me an integer and i'll sell you a state
+ * @param integer $s
+ * @return string
+ * */
+ static function findstate($s)
+ {
+ return inner_findstate($s);
}
}
$findstate3_sig = wrap_php_function(array('xmlrpc_server_methods_container', 'findstate'));
- $obj = new xmlrpc_server_methods_container();
+ $obj = new xmlrpc_server_methods_container();
$findstate4_sig = wrap_php_function(array($obj, 'findstate'));
$agesorter_doc='Send this method an array of [string, int] structs, eg:
<pre>
Dave 35
- Edd 45
+ Edd 45
Fred 23
Barney 37
</pre>
return new xmlrpcresp(new xmlrpcval(array(
"ctLeftAngleBrackets" => new xmlrpcval($lt, "int"),
"ctRightAngleBrackets" => new xmlrpcval($gt, "int"),
- "ctAmpersands" => new xmlrpcval($amp, "int"),
- "ctApostrophes" => new xmlrpcval($ap, "int"),
- "ctQuotes" => new xmlrpcval($qu, "int")),
+ "ctAmpersands" => new xmlrpcval($amp, "int"),
+ "ctApostrophes" => new xmlrpcval($ap, "int"),
+ "ctQuotes" => new xmlrpcval($qu, "int")),
"struct"
));
}
'METHODNAME' => array('METHODCALL'),\r
'PARAMS' => array('METHODCALL', 'METHODRESPONSE'),\r
'FAULT' => array('METHODRESPONSE'),\r
- 'NIL' => array('VALUE') // only used when extension activated\r
+ 'NIL' => array('VALUE'), // only used when extension activated\r
+ 'EX:NIL' => array('VALUE') // only used when extension activated\r
);\r
\r
// define extra types for supporting NULL (useful for json or <NIL/>)\r
/// @deprecated\r
$GLOBALS['xmlrpc_backslash']=chr(92).chr(92);\r
\r
- // set to TRUE to enable correct decoding of <NIL/> values\r
+ // set to TRUE to enable correct decoding of <NIL/> and <EX:NIL/> values\r
$GLOBALS['xmlrpc_null_extension']=false;\r
\r
+ // set to TRUE to enable encoding of php NULL values to <EX:NIL/> instead of <NIL/>\r
+ $GLOBALS['xmlrpc_null_apache_encoding']=false;\r
+\r
// used to store state during parsing\r
// quick explanation of components:\r
// ac - used to accumulate values\r
$GLOBALS['_xh']['vt']=null;\r
break;\r
case 'NIL':\r
+ case 'EX:NIL':\r
if ($GLOBALS['xmlrpc_null_extension'])\r
{\r
if ($GLOBALS['_xh']['vt']!='value')\r
$GLOBALS['_xh']['method']=preg_replace('/^[\n\r\t ]+/', '', $GLOBALS['_xh']['ac']);\r
break;\r
case 'NIL':\r
+ case 'EX:NIL':\r
if ($GLOBALS['xmlrpc_null_extension'])\r
{\r
$GLOBALS['_xh']['vt']='null';\r
}\r
}\r
// be tolerant to line endings, and extra empty lines\r
- $ar = split("\r?\n", trim(substr($data, 0, $pos)));\r
+ $ar = preg_split("/\r?\n/", trim(substr($data, 0, $pos)));\r
while(list(,$line) = @each($ar))\r
{\r
// take care of multi-line headers and cookies\r
$rs.="<${typ}>".preg_replace('/\\.?0+$/','',number_format((double)$val, 128, '.', ''))."</${typ}>";\r
break;\r
case $GLOBALS['xmlrpcNull']:\r
- $rs.="<nil/>";\r
+ if ($GLOBALS['xmlrpc_null_apache_encoding'])\r
+ {\r
+ $rs.="<ex:nil/>";\r
+ }\r
+ else\r
+ {\r
+ $rs.="<nil/>";\r
+ }\r
break;\r
default:\r
// no standard type value should arrive here, but provide a possibility\r
{\r
$xmlrpc_val = new xmlrpcval('', $GLOBALS['xmlrpcString']);\r
}\r
- if (in_array('null_extension', $options))\r
+ else if (in_array('null_extension', $options))\r
{\r
$xmlrpc_val = new xmlrpcval('', $GLOBALS['xmlrpcNull']);\r
}\r
for ($i = 0; $i < sizeof($this->_tests) && !$result->shouldStop(); $i++) {
$this->_tests[$i]->run($result);
if ($show_progress != '') {
- echo $show_progress; flush();
+ echo $show_progress; flush(); ob_flush();
}
}
}
if ((int)ini_get('max_execution_time') < 180)
ini_set('max_execution_time', 180);
+ ini_set('max_execution_time', 180);
$suite = new PHPUnit_TestSuite();
function setUp()
{
global $DEBUG, $LOCALSERVER, $URI;
- $server = split(':', $LOCALSERVER);
+ $server = explode(':', $LOCALSERVER);
if(count($server) > 1)
{
$this->client=new xmlrpc_client($URI, $server[0], $server[1]);
$this->assertEquals(8, $r->faultCode());
// now test a successful connection
- $server = split(':', $LOCALSERVER);
+ $server = explode(':', $LOCALSERVER);
if(count($server) > 1)
{
$this->client->port = $server[1];
echo "<h3>Using lib version: $xmlrpcVersion on PHP version: ".phpversion()."</h3>\n";
echo '<h3>Running '.$suite->testCount().' tests (some of which are multiple) against servers: http://'.htmlspecialchars($LOCALSERVER.$URI).' and https://'.htmlspecialchars($HTTPSSERVER.$HTTPSURI)."\n ...</h3>\n";
flush();
+ ob_flush();
}
else
{
<?php
echo $result->toHTML()."\n</body>\n</html>\n";
}
-?>
+?>
\ No newline at end of file