Skip to content

Commit 2994935

Browse files
committed
prepare for release
1 parent 10cfbeb commit 2994935

File tree

5 files changed

+51
-6
lines changed

5 files changed

+51
-6
lines changed

NEWS.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## v1.0-alpha (2020/12/31)
2+
3+
Hello world!
4+
5+
The initial release of this lib comes at the very end of a difficult year. Let's hope next year will be better for everybody!
6+
7+
All details about the status of the implementation can be found in the source code in file Xmlrpc.php.
8+
9+
A high level overview is: everything is broadly working except for bugs and for the following missing features:
10+
- character set handling: at the moment only Latin1 (aka iso-8859-1) is supported - the `$encoding` argument does nothing
11+
in `xmlrpc_decode()` and `xmlrpc_decode_request()`
12+
- the `$output_options` argument in `xmlrpc_encode_request()` does nothing
13+
- the `xmlrpc_parse_method_descriptions` and `xmlrpc_server_register_introspection_callback` functions exist but do nothing
14+
- xmlrpc server method `system.describeMethods` is not implemented

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
1+
Polyfill-XMLRPC
2+
===============
3+
14
A pure-php reimplementation of the API exposed by the native XML-RPC extension.
25

36
Originally bundled as part of the [phpxmlrpc/extras](https://github.com/gggeek/phpxmlrpc-extras) package.
47

5-
*Work In Progress!*
6-
78
Known differences from the original extension
89
---------------------------------------------
910

11+
### Work in Progress!
12+
13+
This library is not complete yet, and thus to be considered a Work in Progress.
14+
15+
Main features missing are:
16+
- character set handling: at the moment only Latin1 (aka iso-8859-1) is supported - the $encoding argument does nothing in xmlrpc_decode() and xmlrpc_decode_request()
17+
- the $output_options argument in xmlrpc_encode_request() does nothing
18+
- the `xmlrpc_parse_method_descriptions` and `xmlrpc_server_register_introspection_callback` functions exist but do nothing
19+
- xmlrpc server method `system.describeMethods` is not implemented
20+
21+
For a detailed list of all known differences compared to the behaviour of the PHP extension, see comments at the top of
22+
file [XmlRpc.php](src/XmlRpc.php).
23+
24+
### Compatibility goals
25+
1026
We strive to reproduce the same behaviour as the XML-RPC extension to the best "reasonable" extent.
1127

1228
This means that the following are _not_ goals of this package:
@@ -17,8 +33,6 @@ This means that the following are _not_ goals of this package:
1733
- reproducing behaviour of the native extension which is clearly buggy
1834
Eg. the native extension will produce invalid xmlrpc requests when specific values are passed to an `xmlrpc_encode_request` call
1935

20-
For a detailed list of known differences, see comments at the top of file [XmlRpc.php](src/XmlRpc.php).
21-
2236
Installation and usage
2337
----------------------
2438

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": "^5.3.0 || ^7.0 || ^8.0",
14-
"phpxmlrpc/phpxmlrpc": "dev-master as 4.5.0-dev"
14+
"phpxmlrpc/phpxmlrpc": "^4.5.0"
1515
},
1616
"require-dev": {
1717
"ext-curl": "*",

src/Server.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public function register_introspection_callback($function)
2323
* @param array $desc
2424
* @return int 1 if anything got added to the docs, 0 otherwise
2525
* @see XMLRPC_ServerAddIntrospectionData in xmlrpc_intropspection.c
26+
* @todo save as well in a new member of $this->dmap the combined methodList+typeList, so that it can be used by _xmlrpcs_describeMethods
2627
*/
2728
public function add_introspection_data($desc)
2829
{
@@ -35,7 +36,6 @@ public function add_introspection_data($desc)
3536
continue;
3637
}
3738
$methodName = $methodDesc['name'];
38-
/// @todo save as well in a new member of $this->dmap the whole $methodDesc, so that it can be used by _xmlrpcs_describeMethods
3939
if (isset($methodDesc['purpose'])) {
4040
$this->dmap[$methodName]['docstring'] = $methodDesc['purpose'];
4141
$out = 1;
@@ -86,6 +86,18 @@ public static function parse_method_descriptions($xml)
8686
return array();
8787
}
8888

89+
/**
90+
* Reimplement to allow users to register their own 'system.' methods
91+
* @param string $methName
92+
* @return bool
93+
*/
94+
protected function isSyscall($methName)
95+
{
96+
return in_array($methName, array(
97+
'system.listMethods', 'system.methodHelp', 'system.methodSignature', 'system.multicall', 'system.getCapabilities', // 'system.describeMethods',
98+
));
99+
}
100+
89101
/**
90102
* @return array[]
91103
*/

src/XmlRpc.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
* - calling `xmlrpc_server_add_introspection_data` with method signatures makes the server validate the number
5151
* and type of incoming parameters in later calls to `xmlrpc_server_call_method`, relieving the developer from
5252
* having to implement the same checks manually in her php functions
53+
* - marking input parameters as optional in the data passed to calls to `xmlrpc_server_add_introspection_data` and
54+
* `xmlrpc_server_register_introspection_callback` will change the number of method signatures displayed by the
55+
* server in responses to calls to `system.methodSignature`.
56+
* Eg. passing in one signature with one optional param will result in two signatures displayed, one with no params
57+
* and one with one param
5358
*/
5459

5560
namespace PhpXmlRpc\Polyfill\XmlRpc;

0 commit comments

Comments
 (0)