revjim.net Rotating Header Image

PEARs XML-RPC libraries

Pear's XML-RPC library leaves a lot to be desired. The bug I found some time ago is still present. Their code is littered with statements that clutter the name space and make it almost impossible to reuse or follow the logic. Look at this snippet:

    function parseRequest($data="")
    {
        global $XML_RPC_xh,$HTTP_RAW_POST_DATA;
        global $XML_RPC_err, $XML_RPC_str, $XML_RPC_errxml,
            $XML_RPC_defencoding, $XML_RPC_Server_dmap;

        if ($data=="") {
            $data=$HTTP_RAW_POST_DATA;
        }
        $parser = xml_parser_create($XML_RPC_defencoding);

        $XML_RPC_xh[$parser]=array();
        $XML_RPC_xh[$parser]['st']="";
        $XML_RPC_xh[$parser]['cm']=0;
        $XML_RPC_xh[$parser]['isf']=0;
        $XML_RPC_xh[$parser]['params']=array();
        $XML_RPC_xh[$parser]['method']="";

        $plist = '';

Global variables? Umm… no. We're in a class, why not use the variable scoping that such a class provides?

I'm going to look for another library because I'm sick of fixing this one.

Update: I will be using Keith's XML-RPC Library. It isn't written in a class… but the code is top-notch and it's been written flexibly enought to do what I want to do with it. Thank you, Keith!!

Share and Enjoy:
  • Facebook
  • StumbleUpon
  • Digg
  • del.icio.us
  • Google
  • Reddit
  • Technorati
  • Furl
  • Spurl
  • Live
  • Pownce
  • TwitThis