Index: branches/unlabeled/unlabeled-1.21.2/core/kernel/globals.php =================================================================== diff -u -N -r3864 -r4086 --- branches/unlabeled/unlabeled-1.21.2/core/kernel/globals.php (.../globals.php) (revision 3864) +++ branches/unlabeled/unlabeled-1.21.2/core/kernel/globals.php (.../globals.php) (revision 4086) @@ -315,6 +315,18 @@ $ch = curl_init($url); + $dbg = false; + if (defined('DEBUG_MODE') && DEBUG_MODE && dbg_ConstOn('DBG_CURL')) { + $dbg = true; + safeDefine('DBG_CURL_LOGFILE', '/curl.log'); + $log = fopen(FULL_PATH.DBG_CURL_LOGFILE, 'a'); + + curl_setopt($ch, CURLOPT_FILE, $log); + curl_setopt($ch, CURLOPT_VERBOSE, TRUE); + curl_setopt($ch, CURLOPT_STDERR, $log); + //curl_setopt($ch, CURLOPT_WRITEHEADER, $log); + } + if (!is_null($headers)) { curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); } @@ -330,6 +342,12 @@ $ret = curl_exec($ch); curl_close($ch); + + if ($dbg) { + fwrite($log, "\n".$ret); + fclose($log); + } + return $ret; } }