use curl if it's available
This commit is contained in:
parent
5d51287cb9
commit
0198e5e6ba
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user