use curl if it's available

This commit is contained in:
John Bintz 2009-07-15 08:06:33 -04:00
parent 5d51287cb9
commit 0198e5e6ba

View File

@ -50,8 +50,16 @@ class DailyImageWidget {
}
function _get_from_data_source() {
if (extension_loaded('curl')) {
$ch = curl_init($this->data_source);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
curl_close($ch);
return $result;
} else {
return @file_get_contents($this->data_source);
}
}
function _load_data() {
if (($result = $this->_get_cached_data()) === false) {