You are here

function soundcloudfield_curl_get in SoundCloud field 7

Same name and namespace in other branches
  1. 6 soundcloudfield.module \soundcloudfield_curl_get()

Curl helper function.

1 call to soundcloudfield_curl_get()
soundcloudfield_field_formatter_view in ./soundcloudfield.module
Implements hook_field_formatter_view().

File

./soundcloudfield.module, line 427
@author Attila Fekete - http://drupal.org/user/762986

Code

function soundcloudfield_curl_get($url) {
  $curl = curl_init($url);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl, CURLOPT_TIMEOUT, 30);
  if (variable_get('soundcloudfield_curl_followlocation', FALSE)) {
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  }
  $return = curl_exec($curl);
  curl_close($curl);
  return $return;
}