3 * OpenWeatherMap-PHP-API — A php api to parse weather data from http://www.OpenWeatherMap.org .
7 * Please see the LICENSE file distributed with this source code for further
8 * information regarding copyright and licensing.
10 * Please visit the following links to read about the usage policies and the license of
11 * OpenWeatherMap before using this class:
13 * @see http://www.OpenWeatherMap.org
14 * @see http://www.OpenWeatherMap.org/terms
15 * @see http://openweathermap.org/appid
18 namespace Cmfcmf\OpenWeatherMap\Fetcher;
25 class CurlFetcher implements FetcherInterface
30 public function fetch($url)
32 $ch = curl_init($url);
34 curl_setopt($ch, CURLOPT_URL, $url);
35 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
36 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
37 $content = curl_exec($ch);