use curl if it's available
This commit is contained in:
parent
5d51287cb9
commit
0198e5e6ba
@ -50,7 +50,15 @@ class DailyImageWidget {
|
||||
}
|
||||
|
||||
function _get_from_data_source() {
|
||||
return @file_get_contents($this->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() {
|
||||
|
Loading…
Reference in New Issue
Block a user