FIX Doc and log

This commit is contained in:
Laurent Destailleur 2026-02-27 13:49:09 +01:00
parent 15dac27fac
commit ec2f4146c3

View file

@ -32,17 +32,17 @@
*
* You can enable constant MAIN_CURL_DEBUG to get detail of output/input into dolibarr_curl.log file.
*
* @param string $url URL to call.
* @param string $url URL to call.
* @param 'POST'|'GET'|'HEAD'|'PUT'|'PATCH'|'PUTALREADYFORMATED'|'POSTALREADYFORMATED'|'PATCHALREADYFORMATED'|'DELETE' $postorget 'POST', 'GET', 'HEAD', 'PUT', 'PATCH', 'PUTALREADYFORMATED', 'POSTALREADYFORMATED', 'PATCHALREADYFORMATED', 'DELETE'
* @param string $param Parameters of URL (x=value1&y=value2) or may be a formatted content with $postorget='PUTALREADYFORMATED'
* @param int<0,1> $followlocation 0=Do not follow, 1=Follow location.
* @param string[] $addheaders Array of string to add into header. Example: ('Accept: application/xrds+xml', ....)
* @param string[] $allowedschemes List of schemes that are allowed ('http' + 'https' only by default)
* @param int<0,2> $localurl 0=Only external URL are possible, 1=Only local URL, 2=Both external and local URL are allowed.
* @param int<-1,1> $ssl_verifypeer -1=Auto (no ssl check on dev, check on prod), 0=No ssl check, 1=Always ssl check
* @param int $timeoutconnect Timeout connect
* @param int $timeoutresponse Timeout response
* @param array<int, mixed> $otherCurlOptions Array of other curl options to set. Example: array(CURLOPT_SSL_VERIFYPEER => false)
* @param string|array<mixed,mixed> $param Parameters of URL (x=value1&y=value2 urlencoded even with POST) or may be a formatted content with $postorget='POSTALREADYFORMATED/PUTALREADYFORMATED'
* @param int<0,1> $followlocation 0=Do not follow, 1=Follow location.
* @param string[] $addheaders Array of string to add into header. Example: ('Accept: application/xrds+xml', ....)
* @param string[] $allowedschemes List of schemes that are allowed ('http' + 'https' only by default)
* @param int<0,2> $localurl 0=Only external URL are possible, 1=Only local URL, 2=Both external and local URL are allowed.
* @param int<-1,1> $ssl_verifypeer -1=Auto (no ssl check on dev, check on prod), 0=No ssl check, 1=Always ssl check
* @param int $timeoutconnect Timeout for connection time
* @param int $timeoutresponse Timeout for total time including connection
* @param array<int,mixed>|null $otherCurlOptions Array of other curl options to set. Example: array(CURLOPT_SSL_VERIFYPEER => false)
* @return array{http_code:int,content:string,curl_error_no:int,curl_error_msg:string} Returns an associative array containing the response from the server array('http_code'=>http response code, 'content'=>response, 'curl_error_no'=>errno, 'curl_error_msg'=>errmsg...)
*/
function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = 1, $addheaders = array(), $allowedschemes = array('http', 'https'), $localurl = 0, $ssl_verifypeer = -1, $timeoutconnect = 0, $timeoutresponse = 0, $otherCurlOptions = array())
@ -56,7 +56,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
dol_syslog("getURLContent postorget=".$postorget." URL=".$url);
if (getDolGlobalInt('MAIN_CURL_DEBUG')) {
dol_syslog("getURLContent postorget=".$postorget." URL=".$url." param=".$param, LOG_DEBUG, 0, '_curl');
dol_syslog("getURLContent postorget=".$postorget." URL=".$url." json_encode(param)=".json_encode($param), LOG_DEBUG, 0, '_curl');
}
if (!function_exists('curl_init')) {