1
1
Fork 0

Changes requested by @MrPetovan.

This commit is contained in:
Andreas Neustifter 2018-04-27 20:22:17 +00:00
parent 5b4dce5983
commit 9bf58e46f6

View file

@ -38,8 +38,25 @@ class Network
{ {
$ret = fetchUrlFull($url, $binary, $redirects, $timeout, $accept_content, $cookiejar); $ret = fetchUrlFull($url, $binary, $redirects, $timeout, $accept_content, $cookiejar);
return($ret['body']); return $ret['body'];
} }
/**
* @brief Curl wrapper with array of return values.
*
* Inner workings and parameters are the same as @ref fetchUrl but returns an array with
* all the information collected during the fetch.
*
* @param string $url URL to fetch
* @param boolean $binary default false
* TRUE if asked to return binary results (file download)
* @param integer $redirects The recursion counter for internal use - default 0
* @param integer $timeout Timeout in seconds, default system config value or 60 seconds
* @param string $accept_content supply Accept: header with 'accept_content' as the value
* @param string $cookiejar Path to cookie jar file
*
* @return array With all relevant information, 'body' contains the actual fetched content.
*/
public static function fetchUrlFull($url, $binary = false, &$redirects = 0, $timeout = 0, $accept_content = null, $cookiejar = 0) public static function fetchUrlFull($url, $binary = false, &$redirects = 0, $timeout = 0, $accept_content = null, $cookiejar = 0)
{ {
return self::curl( return self::curl(