X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=php%2Fheader.php;h=54f9b1e78f3ffebfb28ba4b53a8b3b6423068bec;hb=df33b26fb9fbd811c1a0c5546646df3da0e6770f;hp=955a4e9e4d70c8c2df8a402dc854628c2758d8c7;hpb=3be4cf02fc55d204b46b9a4386d9943fd5f28b9c;p=plcapi.git diff --git a/php/header.php b/php/header.php index 955a4e9..54f9b1e 100644 --- a/php/header.php +++ b/php/header.php @@ -8,7 +8,8 @@ // Mark Huang // Copyright (C) 2005-2006 The Trustees of Princeton University // -// $Id: header.php,v 1.2 2006/10/27 15:40:20 mlhuang Exp $ +// $Id$ +// $URL$ // // @@ -93,8 +94,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 { @@ -117,7 +118,7 @@ class PLCAPI curl_setopt($curl, CURLOPT_HTTPHEADER, $header); // Set some miscellaneous options - curl_setopt($curl, CURLOPT_TIMEOUT, 30); + curl_setopt($curl, CURLOPT_TIMEOUT, 180); // Get the output of the request curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); @@ -169,6 +170,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]; }