function errTest($result_struct)
 {
     // Check the results for an error
     if (!$result_struct->faultCode()) {
         // Get the results in a value-array
         $values = $result_struct->value();
         // Compile results into PHP array
         $result_array = lib_xmlrpc_decode($values);
         // Check the result for error strings.
         $valid = blogger_checkFaultString($result_array);
         // Return something based on the check
         if ($valid == true) {
             $r = $result_array;
         } else {
             $r = $valid;
         }
     } else {
         $r = $result_struct->faultString();
     }
     return $r;
 }
Exemple #2
0
function lib_xmlrpc_decode($xmlrpc_val)
{
    $kind = $xmlrpc_val->kindOf();
    if ($kind == "scalar") {
        return $xmlrpc_val->scalarval();
    } else {
        if ($kind == "array") {
            $size = $xmlrpc_val->arraysize();
            $arr = array();
            for ($i = 0; $i < $size; $i++) {
                $arr[] = lib_xmlrpc_decode($xmlrpc_val->arraymem($i));
            }
            return $arr;
        } else {
            if ($kind == "struct") {
                $xmlrpc_val->structreset();
                $arr = array();
                while (list($key, $value) = $xmlrpc_val->structeach()) {
                    $arr[$key] = lib_xmlrpc_decode($value);
                }
                return $arr;
            }
        }
    }
}