X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=php%2Fheader.php;h=51728943ca85d73ed25310f730468e69f5367588;hb=a74854dd38cb742b8fdc0d0cda7fff738a95312c;hp=bdcc7471337db339f427587d89aa816031f469f1;hpb=c52672788a06c115dcd761714991be930b3d7c4f;p=plcapi.git diff --git a/php/header.php b/php/header.php index bdcc747..5172894 100644 --- a/php/header.php +++ b/php/header.php @@ -8,7 +8,7 @@ // Mark Huang // Copyright (C) 2005-2006 The Trustees of Princeton University // -// $Id: header.php,v 1.1 2006/10/25 20:32:44 mlhuang Exp $ +// $Id$ // // @@ -93,8 +93,8 @@ class PLCAPI curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 2); if (!empty($this->cainfo)) { curl_setopt($curl, CURLOPT_CAINFO, $this->cainfo); - } elseif (defined('PLC_API_SSL_CRT')) { - curl_setopt($curl, CURLOPT_CAINFO, PLC_API_SSL_CRT); + } elseif (defined('PLC_API_CA_SSL_CRT')) { + curl_setopt($curl, CURLOPT_CAINFO, PLC_API_CA_SSL_CRT); } $url = 'https://'; } else { @@ -105,8 +105,10 @@ class PLCAPI $url .= $this->server . ':' . $this->port . '/' . $this->path; curl_setopt($curl, CURLOPT_URL, $url); - // Marshal the XML-RPC request as a POST variable - $request = xmlrpc_encode_request($method, $args); + // Marshal the XML-RPC request as a POST variable. is an + // extension to the XML-RPC spec that is supported in our custom + // version of xmlrpc.so via the 'allow_null' output_encoding key. + $request = xmlrpc_encode_request($method, $args, array('allow_null' => TRUE)); curl_setopt($curl, CURLOPT_POSTFIELDS, $request); // Construct the HTTP header @@ -167,6 +169,16 @@ class PLCAPI $this->error_log('Fault Code ' . $result['faultCode'] . ': ' . $result['faultString'], 1, true); $ret[] = NULL; + // Thierry - march 30 2007 + // using $adm->error() is broken with begin/commit style + // this is because error() uses last item in trace and checks for ['errors'] + // when using begin/commit we do run internal_call BUT internal_call checks for + // multicall's result globally, not individual results, so ['errors'] comes empty + // I considered hacking internal_call + // to *NOT* maintain this->trace at all when invoked with multicall + // but it is too complex to get all values right + // so let's go for the hacky way, and just record individual errors at the right place + $this->trace[count($this->trace)-1]['errors'][] = end($this->errors); } else { $ret[] = $result[0]; }