aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/network.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/network.php b/include/network.php
index 1b8f0e663..64605749d 100644
--- a/include/network.php
+++ b/include/network.php
@@ -400,6 +400,18 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) {
return($ret);
}
+function z_curl_error($ret) {
+ $output = EMPTY_STR;
+ if (isset($ret['debug'])) {
+ $output .= datetime_convert() . EOL;
+ $output .= t('url: ') . $ret['debug']['url'] . EOL;
+ $output .= t('error_code: ') . $ret['debug']['error_code'] . EOL;
+ $output .= t('error_string: ') . $ret['error'] . EOL;
+ $output .= t('content-type: ') . $ret['debug']['content_type'] . EOL;
+ }
+ return $output;
+}
+
function json_return_and_die($x, $content_type = 'application/json') {
header("Content-type: $content_type");
echo json_encode($x);