1 <?php namespace BookStack\Uploads;
3 use BookStack\Exceptions\HttpFetchException;
9 * Fetch content from an external URI.
12 * @throws HttpFetchException
14 public function fetch(string $uri)
17 curl_setopt_array($ch, [
19 CURLOPT_RETURNTRANSFER => 1,
20 CURLOPT_CONNECTTIMEOUT => 5
23 $data = curl_exec($ch);
24 $err = curl_error($ch);
28 throw new HttpFetchException($err);