简体   繁体   中英

Which XML-RPC Library?

There are at least two implementations of XML-RPC for PHP. Which is best and why?

  1. I've been using the one based on Edd Dumbill's work in the O'Reilly jellyfish book, but I find it extraordinarily awkward and verbose and very hard to debug.
  2. The version built into PHP looks a bit cleaner, but contains warnings that the extension is experimental.

Your favorite? A different one?

XML-RPC is mostly about marshalling data, so performance differences between the native PHP extension and pure PHP implementations is negligible. The PHP builtin is however just about encoding data, so you need an add-on API to actually send RPC calls.

UsefulIncs xmlrpc library was the one susceptible to eval exploits. So I'd eschew that regardless of what it looks today. Better use the native PHP xmlrpc_* functions and forget about the experimental tag.

An alternative would be Zend Frameworks XmlRpc functions, which are pure PHP code and overly verbose, but time-tested. Personally I once had a custom XML-RPC lib which also performed Content-Encoding et al, but today I'd use ZendFrameworks, HordeFramework or PEARs XMLRPC2 . (But am glad we can mostly use JSON nowadays.)

The built-in version (xmlrpc-epi) works. It has some interesting bugs in older versions of PHP but you should be fine as of PHP 5.3.2. I've written a really simple library, called Ripcord, that uses the built-in version but works around the most annoying bugs in older PHP versions. See http://ripcord.googlecode.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM