You are here

private function HtmlAssetInliner::applySettingsToCurl in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 src/Context/HtmlAssetInliner.php \Drupal\tmgmt_smartling\Context\HtmlAssetInliner::applySettingsToCurl()
  2. 8.2 src/Context/HtmlAssetInliner.php \Drupal\tmgmt_smartling\Context\HtmlAssetInliner::applySettingsToCurl()

Parameters

$proj_settings:

$curl:

2 calls to HtmlAssetInliner::applySettingsToCurl()
HtmlAssetInliner::getUrlContents in src/Context/HtmlAssetInliner.php
Gets content for given url using curl and optionally using user agent
HtmlAssetInliner::remote_file_exists in src/Context/HtmlAssetInliner.php
Checks whether or not remote file exists

File

src/Context/HtmlAssetInliner.php, line 223

Class

HtmlAssetInliner

Namespace

Drupal\tmgmt_smartling\Context

Code

private function applySettingsToCurl($proj_settings, $curl) {
  if (!empty($proj_settings['context_skip_host_verifying'])) {
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
  }
  if (!empty($proj_settings['enable_basic_auth'])) {
    curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
    curl_setopt($curl, CURLOPT_USERPWD, $proj_settings['basic_auth']['login'] . ':' . $proj_settings['basic_auth']['password']);
  }
}