private function HtmlAssetInliner::remote_file_exists in TMGMT Translator Smartling 8
Same name and namespace in other branches
- 8.4 src/Context/HtmlAssetInliner.php \Drupal\tmgmt_smartling\Context\HtmlAssetInliner::remote_file_exists()
- 8.2 src/Context/HtmlAssetInliner.php \Drupal\tmgmt_smartling\Context\HtmlAssetInliner::remote_file_exists()
- 8.3 src/Context/HtmlAssetInliner.php \Drupal\tmgmt_smartling\Context\HtmlAssetInliner::remote_file_exists()
Checks whether or not remote file exists
Parameters
$url:
Return value
bool
1 call to HtmlAssetInliner::remote_file_exists()
- HtmlAssetInliner::convertImageToDataUri in src/
Context/ HtmlAssetInliner.php - Converts images to data URIs
File
- src/
Context/ HtmlAssetInliner.php, line 173
Class
Namespace
Drupal\tmgmt_smartling\ContextCode
private function remote_file_exists($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
# don't download content
curl_setopt($ch, CURLOPT_NOBODY, 1);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if (curl_exec($ch) !== FALSE) {
return TRUE;
}
return FALSE;
}