Support for HTTP proxies (new method: xmlrpc_client::setProxy()
)
Support HTTP compression of both requests and responses. Clients can specify what kind of compression they accept for responses between deflate/gzip/any, and whether to compress the requests. Servers by default compress responses to clients that explicitly declare support for compression (new methods: xmlrpc_client::setAcceptedCompression()
, xmlrpc_client::setRequestCompression()
). Note that the ZLIB php extension needs to be enabled in PHP to support compression.
Implement HTTP 1.1 connections, but only if CURL is enabled (added an extra parameter to xmlrpc_client::xmlrpc_client
to set the desired HTTP protocol at creation time and a new supported value for the last parameter of xmlrpc_client::send
, which now can be safely omitted if it has been specified at creation time)
With PHP versions greater than 4.3.8 keep-alives are enabled by default for HTTP 1.1 connections. This should yield faster execution times when making multiple calls in sequence to the same xml-rpc server from a single client.
Introduce support for cookies. Cookies to be sent to the server with a request can be set using xmlrpc_client::setCookie()
, while cookies received from the server are found in xmlrpcresp::cookies()
. It is left to the user to check for validity of received cookies and decide whether they apply to successive calls or not.
Better support for detecting different character set encodings of xml-rpc requests and responses: both client and server objects will correctly detect the charset encoding of received xml, and use an appropriate xml parser.
Supported encodings are US-ASCII, UTF-8 and ISO-8859-1.
Added one new xmlrpcmsg constructor syntax, allowing usage of a single string with the complete URL of the target server
Convert xml-rpc boolean values into native php values instead of 0 and 1
Force the php_xmlrpc_encode
function to properly encode numerically indexed php arrays into xml-rpc arrays (numerically indexed php arrays always start with a key of 0 and increment keys by values of 1)
Prevent the php_xmlrpc_encode
function from further re-encoding any objects of class xmlrpcval
that are passed to it. This allows to call the function with arguments consisting of mixed php values / xmlrpcval objects.
Allow a server to NOT respond to system.* method calls (setting the $server->allow_system_funcs
property).
Implement a new xmlrpcval method to determine if a value of type struct has a member of a given name without having to loop trough all members: xmlrpcval::structMemExists()
Expand methods xmlrpcval::addArray
, addScalar
and addStruct
allowing extra php values to be added to xmlrpcval objects already formed.
Let the xmlrpc_client::send
method accept an XML string for sending instead of an xmlrpcmsg object, to facilitate debugging and integration with the php native xmlrpc extension
Extend the php_xmlrpc_encode
and php_xmlrpc_decode
functions to allow serialization and rebuilding of PHP objects. To successfully rebuild a serialized object, the object class must be defined in the deserializing end of the transfer. Note that object members of type resource will be deserialized as NULL values.
Note that his has been implemented adding a "php_class" attribute to xml representation of xmlrpcval of STRUCT type, which, strictly speaking, breaks the xml-rpc spec. Other xmlrpc implementations are supposed to ignore such an attribute (unless they implement a brain-dead custom xml parser...), so it should be safe enabling it in heterogeneous environments. The activation of this feature is done by usage of an option passed as second parameter to both php_xmlrpc_encode
and php_xmlrpc_decode
.
Extend the php_xmlrpc_encode
function to allow automatic serialization of is08601-conforming php strings as datetime.iso8601 xmlrpcvals, by usage of an optional parameter
Added an automatic stub code generator for converting xmlrpc methods to php functions and vice-versa.
This is done via two new functions: wrap_php_function
and wrap_xmlrpc_method
, and has many caveats, with php being a typeless language and all...
With PHP versions lesser than 5.0.3 wrapping of php functions into xmlrpc methods is not supported yet.
Allow object methods to be used in server dispatch map
Added a complete debugger solution, in the debugger
folder
Added configurable server-side debug messages, controlled by the new method xmlrpc_server::SetDebug()
. At level 0, no debug messages are sent to the client; level 1 is the same as the old behaviour; at level 2 a lot more info is echoed back to the client, regarding the received call; at level 3 all warnings raised during server processing are trapped (this prevents breaking the xml to be echoed back to the client) and added to the debug info sent back to the client
New XML parsing code, yields smaller memory footprint and faster execution times, not to mention complete elimination of the dreaded eval()
construct, so prone to code injection exploits
Rewritten most of the error messages, making text more explicative