+ $ret = z_fetch_url(
+ $url,
+ $binary,
+ $redirects,
+ array('timeout'=>$timeout,
+ 'accept_content'=>$accept_content,
+ 'cookiejar'=>$cookiejar
+ ));
+
+ return($ret['body']);
+}}
+
+if(!function_exists('z_fetch_url')){
+/**
+ * @brief fetches an URL.
+ *
+ * @param string $url
+ * URL to fetch
+ * @param boolean $binary default false
+ * TRUE if asked to return binary results (file download)
+ * @param int $redirects default 0
+ * internal use, recursion counter
+ * @param array $opts (optional parameters) assoziative array with:
+ * * \b accept_content => supply Accept: header with 'accept_content' as the value
+ * * \b timeout => int seconds, default system config value or 60 seconds
+ * * \b http_auth => username:password
+ * * \b novalidate => do not validate SSL certs, default is to validate using our CA list
+ * * \b nobody => only return the header
+ * * \b cookiejar => path to cookie jar file
+ *
+ * @return array an assoziative array with:
+ * * \e int \b return_code => HTTP return code or 0 if timeout or failure
+ * * \e boolean \b success => boolean true (if HTTP 2xx result) or false
+ * * \e string \b header => HTTP headers
+ * * \e string \b body => fetched content
+ */
+function z_fetch_url($url,$binary = false, &$redirects = 0, $opts=array()) {
+
+ $ret = array('return_code' => 0, 'success' => false, 'header' => "", 'body' => "");
+
+