Parse the config and replace curl.* configurators into the constant based values so it can be used elsewhere
array|Collection $config The configuration we want to parse:
array
public static function parseCurlConfig($config) {
$curlOptions = array();
foreach ($config as $key => $value) {
if (!is_numeric($key) && defined($key)) {
// Convert constants represented as string to constant int values
$key = constant($key);
}
$curlOptions[$key] = is_string($value) && defined($value) ? constant($value) : $value;
}
return $curlOptions;
}