You are here

function _soundcloudfield_curl_get in SoundCloud field 8

Curl helper function.

1 call to _soundcloudfield_curl_get()
SoundCloudDefaultFormatter::viewElements in src/Plugin/Field/FieldFormatter/SoundCloudDefaultFormatter.php
Builds a renderable array for a field value.

File

./soundcloudfield.module, line 21
@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;
}